diff --git a/src/test/java/org/luaj/vm/LuaJTest.java b/src/test/java/org/luaj/vm/LuaJTest.java index 384f0b31..1cad9f70 100644 --- a/src/test/java/org/luaj/vm/LuaJTest.java +++ b/src/test/java/org/luaj/vm/LuaJTest.java @@ -87,7 +87,11 @@ public class LuaJTest extends TestCase { runTest( "errors" ); } - public void testLoops() throws IOException, InterruptedException { + public void testHugeTable() throws IOException, InterruptedException { + runTest( "hugetable" ); + } + + public void testLoops() throws IOException, InterruptedException { runTest( "loops" ); } diff --git a/src/test/res/hugetable.lua b/src/test/res/hugetable.lua new file mode 100644 index 00000000..ce12f905 --- /dev/null +++ b/src/test/res/hugetable.lua @@ -0,0 +1,16 @@ +-- test table with more than 50 non-sequential integer elements +local t = { + [2000]='a', [2001]='b', [2002]='c', [2003]='d', [2004]='e', [2005]='f', [2006]='g', [2007]='h', [2008]='i', [2009]='j', + [3000]='a', [3001]='b', [3002]='c', [3003]='d', [3004]='e', [3005]='f', [3006]='g', [3007]='h', [3008]='i', [3009]='j', + [4000]='a', [4001]='b', [4002]='c', [4003]='d', [4004]='e', [4005]='f', [4006]='g', [4007]='h', [4008]='i', [4009]='j', + [5000]='a', [5001]='b', [5002]='c', [5003]='d', [5004]='e', [5005]='f', [5006]='g', [5007]='h', [5008]='i', [5009]='j', + [6000]='a', [6001]='b', [6002]='c', [6003]='d', [6004]='e', [6005]='f', [6006]='g', [6007]='h', [6008]='i', [6009]='j', + [7000]='a', [7001]='b', [7002]='c', [7003]='d', [7004]='e', [7005]='f', [7006]='g', [7007]='h', [7008]='i', [7009]='j', + [8000]='a', [8001]='b', [8002]='c', [8003]='d', [8004]='e', [8005]='f', [8006]='g', [8007]='h', [8008]='i', [8009]='j', +} + +for i=2000,8000,1000 do + for j=0,9,1 do + print( 't['..tostring(i+j)..']', t[i+j] ) + end +end \ No newline at end of file