public void BracketsErrorGeneratedTest() { SyntaxTree tree = SyntaxTree.CreateFromString("}("); var generator = new TestGenerator(); generator.GenerateTestFromString("}(", "BracketsError"); new BracketsError_Generated().Test(new Tester(tree)); }
public void PrefixExpNestedTest() { SyntaxTree tree = SyntaxTree.CreateFromString("foo.bar(t[5]).set():run{}"); Assert.Equal(0, tree.ErrorList.Count); var generator = new TestGenerator(); generator.GenerateTestFromString("foo.bar(t[5]).set():run{}", "PrefixExpNested"); new PrefixExpNested_Generated().Test(new Tester(tree)); }
public void NestedTableTest() { SyntaxTree tree = SyntaxTree.CreateFromString(@" t = { f = { } }"); Assert.Equal(0, tree.ErrorList.Count); var generator = new TestGenerator(); generator.GenerateTestFromString(@" t = { f = { } }", "NestedTable"); new NestedTable_Generated().Test(new Tester(tree)); }
public void PrefixExpFirstGeneratedTest() { SyntaxTree tree = SyntaxTree.CreateFromString("(f)[s] = k"); var generator = new TestGenerator(); generator.GenerateTestFromString("(f)[s] = k", "PrefixExpFirst"); new PrefixExpFirst_Generated().Test(new Tester(tree)); Assert.Equal(0, tree.ErrorList.Count); }
public void LucaDemoGeneratedTest() { SyntaxTree tree = SyntaxTree.CreateFromString(@" x= 1 -- this is an add function add = function(x, y) return x+y;-- adding end get_zero = function() return 0 end"); var generator = new TestGenerator(); generator.GenerateTestFromString(@" x= 1 -- this is an add function add = function(x, y) return x+y;-- adding end get_zero = function() return 0 end", "LucaDemo"); Debug.WriteLine(tree.ErrorList.Count); new LucaDemo_Generated().Test(new Tester(tree)); Assert.Equal(0, tree.ErrorList.Count); }
public void IfStatementTest() { SyntaxTree tree = SyntaxTree.CreateFromString(@" if directionIndex then vistedRooms = vistedRooms + 1; else currentRoom = roomStack:pop(); end"); Assert.Equal(0, tree.ErrorList.Count); var generator = new TestGenerator(); generator.GenerateTestFromString(@" if directionIndex then vistedRooms = vistedRooms + 1; else currentRoom = roomStack:pop(); end", "IfStatement"); new IfStatement_Generated().Test(new Tester(tree)); }
public void GrabKeyFromTableGeneratedTest() { SyntaxTree tree = SyntaxTree.CreateFromString("t[\"this is a test that grabs this key in Lua\"]"); var generator = new TestGenerator(); generator.GenerateTestFromString("t[\"this is a test that grabs this key in Lua\"]", "GrabKeyFromTable"); new GrabKeyFromTable_Generated().Test(new Tester(tree)); }
public void EmptyProgramGeneratedTest() { SyntaxTree tree = SyntaxTree.CreateFromString(""); var generator = new TestGenerator(); generator.GenerateTestFromString("", "EmptyProgram"); new EmptyProgram_Generated().Test(new Tester(tree)); Assert.Equal(0, tree.ErrorList.Count); }
public void EmbeddedFunctionTest() { SyntaxTree tree = SyntaxTree.CreateFromString(@" foo = function() bar = function() end end"); Assert.Equal(0, tree.ErrorList.Count); var generator = new TestGenerator(); generator.GenerateTestFromString(@" foo = function() bar = function() end end", "EmbeddedFunction"); new EmbeddedFunction_Generated().Test(new Tester(tree)); }