diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs index 2add011853..776361958e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs @@ -1744,11 +1744,12 @@ default } [Test] - [ExpectedException(typeof(System.Exception))] public void TestSyntaxError() { TestHelpers.InMethod(); + bool gotException = false; + string input = @"default { state_entry() @@ -1764,19 +1765,22 @@ default } catch (System.Exception e) { - // The syntax error is on line 6, char 5 (expected ';', found + // The syntax error is on line 5, char 4 (expected ';', found // '}'). - Assert.AreEqual("(4,4) syntax error", e.Message); - throw; + Assert.AreEqual("(5,4) syntax error", e.Message); + gotException = true; } + + Assert.That(gotException, Is.True); } [Test] - [ExpectedException(typeof(System.Exception))] public void TestSyntaxErrorDeclaringVariableInForLoop() { TestHelpers.InMethod(); + bool gotException = false; + string input = @"default { state_entry() @@ -1792,11 +1796,13 @@ default } catch (System.Exception e) { - // The syntax error is on line 5, char 14 (Syntax error) - Assert.AreEqual("(3,13) syntax error", e.Message); + // The syntax error is on line 4, char 13 (Syntax error) + Assert.AreEqual("(4,13) syntax error", e.Message); - throw; + gotException = true; } + + Assert.That(gotException, Is.True); } } }