mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
Add lsl arg syntax checking for control event
This commit is contained in:
@@ -278,6 +278,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
|||||||
TestIntVecVecArgEvent("at_target");
|
TestIntVecVecArgEvent("at_target");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestControlEvent()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// TestHelpers.EnableLogging();
|
||||||
|
|
||||||
|
TestKeyIntIntArgEvent("control");
|
||||||
|
}
|
||||||
|
|
||||||
private void TestIntArgEvent(string eventName)
|
private void TestIntArgEvent(string eventName)
|
||||||
{
|
{
|
||||||
TestCompile("default { " + eventName + "(integer n) {} }", false);
|
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);
|
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)
|
private void TestCompile(string script, bool expectException)
|
||||||
{
|
{
|
||||||
bool gotException = false;
|
bool gotException = false;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user