From 1f8888a287f6867a71e997363787a6979b70e2db Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 27 Sep 2008 05:58:52 +0000 Subject: [PATCH] Update unit tests --- .../CodeTools/Tests/CSCodeGeneratorTest.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs index 4e2766c3bb..356f547f82 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs @@ -1544,7 +1544,7 @@ default } [Test] - [ExpectedException(typeof(Tools.CSToolsException))] + [ExpectedException(typeof(System.Exception))] public void TestSyntaxError() { string input = @"default @@ -1560,21 +1560,17 @@ default CSCodeGenerator cg = new CSCodeGenerator(); cg.Convert(input); } - catch (Tools.CSToolsException e) + catch (System.Exception e) { // The syntax error is on line 6, char 5 (expected ';', found // '}'). - Regex r = new Regex("Line ([0-9]+), char ([0-9]+)"); - Match m = r.Match(e.Message); - Assert.AreEqual("6", m.Groups[1].Value); - Assert.AreEqual("5", m.Groups[2].Value); - + Assert.AreEqual("Line (5,4) Line 6, char 5: syntax error", e.Message); throw; } } [Test] - [ExpectedException(typeof(Tools.CSToolsException))] + [ExpectedException(typeof(System.Exception))] public void TestSyntaxErrorDeclaringVariableInForLoop() { string input = @"default @@ -1590,13 +1586,10 @@ default CSCodeGenerator cg = new CSCodeGenerator(); cg.Convert(input); } - catch (Tools.CSToolsException e) + catch (System.Exception e) { // The syntax error is on line 5, char 14 (Syntax error) - Regex r = new Regex("Line ([0-9]+), char ([0-9]+)"); - Match m = r.Match(e.Message); - Assert.AreEqual("5", m.Groups[1].Value); - Assert.AreEqual("14", m.Groups[2].Value); + Assert.AreEqual("Line (4,13) Line 5, char 14: syntax error", e.Message); throw; }