|
@@ -1,8 +1,10 @@
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
|
+using System.IO;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
using System.Text;
|
|
|
using MoonSharp.Interpreter.Interop;
|
|
using MoonSharp.Interpreter.Interop;
|
|
|
|
|
+using MoonSharp.Interpreter.Loaders;
|
|
|
using NUnit.Framework;
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
@@ -19,6 +21,13 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
return "X" + obj.Method1(0.17);
|
|
return "X" + obj.Method1(0.17);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ public static class OverloadsExtMethods2
|
|
|
|
|
+ {
|
|
|
|
|
+ public static string MethodXXX(this UserDataOverloadsTests.OverloadsTestClass obj, string x, bool b)
|
|
|
|
|
+ {
|
|
|
|
|
+ return "X!";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
[TestFixture]
|
|
@@ -191,6 +200,28 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
RunTestOverload("o:method3()", "X3");
|
|
RunTestOverload("o:method3()", "X3");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ [Test]
|
|
|
|
|
+ public void Interop_Overloads_Twice_ExtMethods1()
|
|
|
|
|
+ {
|
|
|
|
|
+ UserData.RegisterExtensionType(typeof(OverloadsExtMethods));
|
|
|
|
|
+
|
|
|
|
|
+ RunTestOverload("o:method1('xx', true)", "X1");
|
|
|
|
|
+
|
|
|
|
|
+ UserData.RegisterExtensionType(typeof(OverloadsExtMethods2));
|
|
|
|
|
+
|
|
|
|
|
+ RunTestOverload("o:methodXXX('xx', true)", "X!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [Test]
|
|
|
|
|
+ public void Interop_Overloads_Twice_ExtMethods2()
|
|
|
|
|
+ {
|
|
|
|
|
+ UserData.RegisterExtensionType(typeof(OverloadsExtMethods));
|
|
|
|
|
+ UserData.RegisterExtensionType(typeof(OverloadsExtMethods2));
|
|
|
|
|
+
|
|
|
|
|
+ RunTestOverload("o:method1('xx', true)", "X1");
|
|
|
|
|
+ RunTestOverload("o:methodXXX('xx', true)", "X!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
[Test]
|
|
[Test]
|
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
|
public void Interop_Overloads_ExtMethods2()
|
|
public void Interop_Overloads_ExtMethods2()
|
|
@@ -289,6 +320,5 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|