From 9fc027273bd04421bf5341d711013237bbe67d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 25 Feb 2019 12:33:38 +0100 Subject: [PATCH] _js: make the interactive test a bit more complete In particular, include a line where there's a complete and incomplete statement. --- _js/testmain.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/_js/testmain.js b/_js/testmain.js index 62be18618..25f673036 100644 --- a/_js/testmain.js +++ b/_js/testmain.js @@ -130,31 +130,31 @@ const printer = syntax.NewPrinter() { // using the parser interactively - const inputs = [ + const lines = [ "foo\n", "bar; baz\n", "\n", - "'incom\n", + "foo; 'incom\n", "plete'\n", ] const wantCallbacks = [ {"count": 1, "incomplete": false}, {"count": 2, "incomplete": false}, {"count": 0, "incomplete": false}, - {"count": 0, "incomplete": true}, - {"count": 1, "incomplete": false}, + {"count": 1, "incomplete": true}, + {"count": 2, "incomplete": false}, ] var gotCallbacks = [] const src = {"read": function(size) { - if (inputs.length == 0) { + if (lines.length == 0) { if (gotCallbacks.length == 0) { throw "did not see any callbacks before EOF" } return null // EOF } - s = inputs[0] - inputs.shift() + s = lines[0] + lines.shift() return s }}