Add bytecode generation tests
This commit is contained in:
@@ -37,13 +37,13 @@ public class TestLuaJC {
|
||||
// create the script
|
||||
public static String name = "script";
|
||||
public static String script =
|
||||
"local a = 1\n"+
|
||||
"local b\n"+
|
||||
"function c()\n"+
|
||||
" b=5\n" +
|
||||
" return a\n"+
|
||||
"local a = unpack()\n"+
|
||||
"local b = c and { d = e }\n"+
|
||||
"local f\n"+
|
||||
"local function g()\n"+
|
||||
" return f\n"+
|
||||
"end\n"+
|
||||
"return c(),b\n";
|
||||
"";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println(script);
|
||||
|
||||
@@ -398,5 +398,14 @@ public class FragmentsTest extends TestSuite {
|
||||
"end\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