Skip to content

Commit 0e471a2

Browse files
committed
Other: Fixed failing tokenize test case
1 parent ffdc93c commit 0e471a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/api_tokenize.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ tape.test("tokenize", function(test) {
2727

2828
tn = tokenize("// line comment");
2929
test.equal(tn.next(), null, "should skip line comments on a single line");
30-
tn = tokenize("/// line comment\n");
31-
test.equal(tn.cmnt(1), "line comment", "should peek for trailing line comments when on the next line");
30+
tn = tokenize("a /// line comment\n");
31+
tn.next();
32+
test.equal(tn.cmnt(1), "line comment", "should peek for trailing line comments");
3233
tn = tokenize("/* block comment */");
3334
test.equal(tn.next(), null, "should skip block comments on a single line");
3435
tn = tokenize("/// line comment\na\n");
3536
tn.next();
36-
test.equal(tn.cmnt(1), "line comment", "should keep leading comments around while on the next line");
37+
test.equal(tn.cmnt(), "line comment", "should keep leading comments around while on the next line");
3738

3839
test.ok(expectError("something; /"), "should throw for unterminated line comments");
3940
test.ok(expectError("something; /* comment"), "should throw for unterminated block comments");

0 commit comments

Comments
 (0)