test: found a bug in my tables impl

main
_ 2023-09-26 20:47:47 -05:00
parent 1d813b0f44
commit 0d5e1098bc
2 changed files with 32 additions and 2 deletions

View File

@ -275,6 +275,21 @@ fn tables_1 () {
run_source (&[], src);
}
#[test]
fn tables_2 () {
let src = r#"
print " 3"
local c = {}
local a = { c }
print (a [1])
c [2] = "eee"
print (a [2])
"#;
run_source (&[], src);
}
#[test]
fn value_size () {
// Per https://www.lua.org/doc/jucs05.pdf,

View File

@ -1,4 +1,4 @@
print "# 1"
print " 1"
print (nil)
print (false)
@ -7,7 +7,7 @@ print (1993)
print (1993.00)
print "Hello."
print "# 2"
print " 2"
local t = {}
print (t)
@ -20,3 +20,18 @@ print (t.x)
t.t = { 3.14159 }
print (t ["t"][1])
print " 3"
local c = {}
c [1] = "ddd"
local a = { c }
local b = { c }
print (a [1])
print (b [1])
c [2] = "eee"
print (a [2])
print (b [2])