Add lsl arg syntax checking for control event

master-beforevarregion
Justin Clark-Casey (justincc) 2013-12-21 01:00:50 +00:00
parent f1cd813a29
commit 2f94165dcc
2 changed files with 9890 additions and 9560 deletions

View File

@ -278,6 +278,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
TestIntVecVecArgEvent("at_target");
}
[Test]
public void TestControlEvent()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
TestKeyIntIntArgEvent("control");
}
private void TestIntArgEvent(string eventName)
{
TestCompile("default { " + eventName + "(integer n) {} }", false);
@ -318,6 +327,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
TestCompile("default { " + eventName + "(integer n, vector v, vector w, vector x) {{}} }", true);
}
private void TestKeyIntIntArgEvent(string eventName)
{
TestCompile("default { " + eventName + "(key k, integer n, integer o) {} }", false);
TestCompile("default { " + eventName + "{{}} }", true);
TestCompile("default { " + eventName + "(string s) {{}} }", true);
TestCompile("default { " + eventName + "(key k, integer n, integer o, integer p) {{}} }", true);
}
private void TestCompile(string script, bool expectException)
{
bool gotException = false;

File diff suppressed because it is too large Load Diff