Skip to content

Commit f2b2d12

Browse files
committed
Partition T word into a separate group
1 parent 4ce6a3e commit f2b2d12

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Interpreter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const partitionWordsByGroup = (words = []) => {
3535
const word = words[i];
3636
const letter = word[0];
3737

38-
if ((letter === 'G') || (letter === 'M')) {
38+
if ((letter === 'G') || (letter === 'M') || (letter === 'T')) {
3939
groups.push([word]);
4040
continue;
4141
}

test/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,10 @@ describe('G-code Interpreter', () => {
257257
}
258258
M6(args) {
259259
expect(args).to.be.an('object');
260-
expect(args.T).to.equal(1);
261260
this.calls.M6 = (this.calls.M6 || 0) + 1;
262261
}
263262
T(args) {
264263
expect(args).to.be.an('number');
265-
expect(args).to.equal(2);
266264
this.calls.T = (this.calls.T || 0) + 1;
267265
}
268266
F(args) {
@@ -286,7 +284,7 @@ describe('G-code Interpreter', () => {
286284
expect(runner.calls.M3).to.equal(31);
287285
expect(runner.calls.M5).to.equal(1);
288286
expect(runner.calls.M6).to.equal(1);
289-
expect(runner.calls.T).to.equal(1);
287+
expect(runner.calls.T).to.equal(2);
290288
expect(runner.calls.F).to.equal(1);
291289
expect(runner.calls.G0).to.equal(2);
292290
expect(runner.calls.G1).to.equal(31);
@@ -301,7 +299,7 @@ describe('G-code Interpreter', () => {
301299
expect(runner.calls.M3).to.equal(31);
302300
expect(runner.calls.M5).to.equal(1);
303301
expect(runner.calls.M6).to.equal(1);
304-
expect(runner.calls.T).to.equal(1);
302+
expect(runner.calls.T).to.equal(2);
305303
expect(runner.calls.F).to.equal(1);
306304
expect(runner.calls.G0).to.equal(2);
307305
expect(runner.calls.G1).to.equal(31);

0 commit comments

Comments
 (0)