From 0e471a2516bde3cd3c27b2691afa0dcfbb01f042 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Tue, 18 Apr 2017 21:44:01 +0200 Subject: [PATCH] Other: Fixed failing tokenize test case --- tests/api_tokenize.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/api_tokenize.js b/tests/api_tokenize.js index d97efb690..5db54e544 100644 --- a/tests/api_tokenize.js +++ b/tests/api_tokenize.js @@ -27,13 +27,14 @@ tape.test("tokenize", function(test) { tn = tokenize("// line comment"); test.equal(tn.next(), null, "should skip line comments on a single line"); - tn = tokenize("/// line comment\n"); - test.equal(tn.cmnt(1), "line comment", "should peek for trailing line comments when on the next line"); + tn = tokenize("a /// line comment\n"); + tn.next(); + test.equal(tn.cmnt(1), "line comment", "should peek for trailing line comments"); tn = tokenize("/* block comment */"); test.equal(tn.next(), null, "should skip block comments on a single line"); tn = tokenize("/// line comment\na\n"); tn.next(); - test.equal(tn.cmnt(1), "line comment", "should keep leading comments around while on the next line"); + test.equal(tn.cmnt(), "line comment", "should keep leading comments around while on the next line"); test.ok(expectError("something; /"), "should throw for unterminated line comments"); test.ok(expectError("something; /* comment"), "should throw for unterminated block comments");