summary refs log tree commit diff stats
path: root/test.lua
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2019-04-08 14:54:07 -0300
committerSoniEx2 <endermoneymod@gmail.com>2019-04-08 14:54:07 -0300
commit893ca6ca0d379c0fbf6a6b4d70b551a3005b9de8 (patch)
treef1d71c9d71f2d291a4e6409665d91844cc754952 /test.lua
parent772e7a9755d1e7b83cfcd3d979e3dcafbbce0078 (diff)
Fix issues with newline handling in long strings
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/test.lua b/test.lua
index 4e9b132..b0b7082 100644
--- a/test.lua
+++ b/test.lua
@@ -260,7 +260,7 @@ end -- long string
 do -- long string edge cases
     local luatokens = require "luatokens"
     local tokens = luatokens.defs
-    local state, err, etoken, estate = parser.parse(tokens, "[==[]=]==][==[]]==][=[] ]=]")
+    local state, err, etoken, estate = parser.parse(tokens, "[==[]=]==][==[]]==][=[] ]=][[\n]][[\n ]]")
     local case = case()
     if not state then
         print(case, "---- IN  TOKENS ----")
@@ -276,8 +276,12 @@ do -- long string edge cases
         assert(table.remove(state, 1) == "]")
         assert(table.remove(state, 1) == luatokens.tokens.TK_STRING)
         assert(table.remove(state, 1) == "] ")
+        assert(table.remove(state, 1) == luatokens.tokens.TK_STRING)
+        assert(table.remove(state, 1) == "")
+        assert(table.remove(state, 1) == luatokens.tokens.TK_STRING)
+        assert(table.remove(state, 1) == " ")
         assert(table.remove(state, 1) == nil)
-        assert(state.line == 1 or not state.line)
+        assert(state.line == 3 or not state.line)
     end
 end -- long string