diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs index c482422..a7d4fa9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs | |||
@@ -1516,6 +1516,31 @@ default | |||
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | [Test] | 1518 | [Test] |
1519 | public void TestForLoopWithNoAssignment() | ||
1520 | { | ||
1521 | string input = @"default | ||
1522 | { | ||
1523 | state_entry() | ||
1524 | { | ||
1525 | integer x = 4; | ||
1526 | for (; 1<0; x += 2); | ||
1527 | } | ||
1528 | }"; | ||
1529 | |||
1530 | string expected = | ||
1531 | "\n public void default_event_state_entry()" + | ||
1532 | "\n {" + | ||
1533 | "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(4);" + | ||
1534 | "\n for (; new LSL_Types.LSLInteger(1) < new LSL_Types.LSLInteger(0); x += new LSL_Types.LSLInteger(2))" + | ||
1535 | "\n ;" + | ||
1536 | "\n }\n"; | ||
1537 | |||
1538 | CSCodeGenerator cg = new CSCodeGenerator(); | ||
1539 | string output = cg.Convert(input); | ||
1540 | Assert.AreEqual(expected, output); | ||
1541 | } | ||
1542 | |||
1543 | [Test] | ||
1519 | public void TestAssignmentInIfWhileDoWhile() | 1544 | public void TestAssignmentInIfWhileDoWhile() |
1520 | { | 1545 | { |
1521 | string input = @"default | 1546 | string input = @"default |