summary refs log tree commit diff stats
path: root/test/testp.lua
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2024-06-19 23:44:42 -0300
committerSoniEx2 <endermoneymod@gmail.com>2024-06-19 23:48:25 -0300
commit13ba6740870d99749f0341b5a38e1e9213162647 (patch)
tree860aa0171f97ca97a6fa9d7bffa04db39d85ae3b /test/testp.lua
parent70a7abacbb36783fb77025814242faf32a6c8a47 (diff)
Tokenize numbers as strings
"Fixes" Lua 5.2 support, but makes certain number formats non-portable,
for example hex floats will not work before Lua 5.3.
Diffstat (limited to 'test/testp.lua')
-rw-r--r--test/testp.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/testp.lua b/test/testp.lua
index 1ab5304..7c4bf48 100644
--- a/test/testp.lua
+++ b/test/testp.lua
@@ -423,30 +423,30 @@ do -- numbers
     else
         -- integers
         assert(table.remove(state, 1) == luatokens.tokens.TK_INT)
-        assert(table.remove(state, 1) == 3)
+        assert(table.remove(state, 1) == "3")
         assert(table.remove(state, 1) == luatokens.tokens.TK_INT)
-        assert(table.remove(state, 1) == 345)
+        assert(table.remove(state, 1) == "345")
         assert(table.remove(state, 1) == luatokens.tokens.TK_INT)
-        assert(table.remove(state, 1) == 0xff)
+        assert(table.remove(state, 1) == "0xff")
         assert(table.remove(state, 1) == luatokens.tokens.TK_INT)
-        assert(table.remove(state, 1) == 0xBEBADA)
+        assert(table.remove(state, 1) == "0xBEBADA")
         -- floats
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 3.0)
+        assert(table.remove(state, 1) == "3.0")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 3.1416)
+        assert(table.remove(state, 1) == "3.1416")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 314.16e-2)
+        assert(table.remove(state, 1) == "314.16e-2")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 0.31416E1)
+        assert(table.remove(state, 1) == "0.31416E1")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 34e1)
+        assert(table.remove(state, 1) == "34e1")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 0.1171875)
+        assert(table.remove(state, 1) == "0x0.1E")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == 162.1875)
+        assert(table.remove(state, 1) == "0xA23p-4")
         assert(table.remove(state, 1) == luatokens.tokens.TK_FLT)
-        assert(table.remove(state, 1) == math.pi)
+        assert(table.remove(state, 1) == "0X1.921FB54442D18P+1")
         assert(table.remove(state, 1) == nil)
         assert(state.line == 3)
     end