Add bytecode generation tests
This commit is contained in:
@@ -37,13 +37,13 @@ public class TestLuaJC {
|
|||||||
// create the script
|
// create the script
|
||||||
public static String name = "script";
|
public static String name = "script";
|
||||||
public static String script =
|
public static String script =
|
||||||
"local a = 1\n"+
|
"local a = unpack()\n"+
|
||||||
"local b\n"+
|
"local b = c and { d = e }\n"+
|
||||||
"function c()\n"+
|
"local f\n"+
|
||||||
" b=5\n" +
|
"local function g()\n"+
|
||||||
" return a\n"+
|
" return f\n"+
|
||||||
"end\n"+
|
"end\n"+
|
||||||
"return c(),b\n";
|
"";
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
System.out.println(script);
|
System.out.println(script);
|
||||||
|
|||||||
@@ -398,5 +398,14 @@ public class FragmentsTest extends TestSuite {
|
|||||||
"end\n"+
|
"end\n"+
|
||||||
"return c(),b\n" );
|
"return c(),b\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testUninitializedAroundBranch() {
|
||||||
|
runFragment( LuaValue.valueOf(333),
|
||||||
|
"local state\n"+
|
||||||
|
"if _G then\n"+
|
||||||
|
" state = 333\n"+
|
||||||
|
"end\n"+
|
||||||
|
"return state\n" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user