From 16cf5aa2b83ae8e18f944c5cfec818d2211d04d1 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Thu, 31 Jul 2008 07:11:49 +0000 Subject: Allow the list hack from issue 1863 to compile, however its behavior is different than in SL. See http://opensimulator.org/mantis/view.php?id=1863 for details. --- .../Shared/CodeTools/CSCodeGeneratorTest.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGeneratorTest.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGeneratorTest.cs index 19c08ed..427390b 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGeneratorTest.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGeneratorTest.cs @@ -1558,6 +1558,31 @@ default } [Test] + public void TestLSLListHack() + { + string input = @"default +{ + state_entry() + { + list l = [""hello""]; + l = (l=[]) + l + ""world""; + } +}"; + + string expected = @" + public void default_event_state_entry() + { + LSL_Types.list l = new LSL_Types.list(""hello""); + l = (l = new LSL_Types.list()) + l + ""world""; + } +"; + + CSCodeGenerator cg = new CSCodeGenerator(); + string output = cg.Convert(input); + Assert.AreEqual(expected, output); + } + + [Test] [ExpectedException("Tools.CSToolsException")] public void TestSyntaxError() { -- cgit v1.1