|
@@ -26,7 +26,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_IntPropertyGetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_IntPropertyGetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
x = myobj.IntProp;
|
|
x = myobj.IntProp;
|
|
@@ -46,7 +46,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual(321, res.Number);
|
|
Assert.AreEqual(321, res.Number);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_NIntPropertyGetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_NIntPropertyGetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
x = myobj1.NIntProp;
|
|
x = myobj1.NIntProp;
|
|
@@ -71,7 +71,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual(DataType.Nil, res.Tuple[1].Type);
|
|
Assert.AreEqual(DataType.Nil, res.Tuple[1].Type);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_ObjPropertyGetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_ObjPropertyGetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
x = myobj1.ObjProp;
|
|
x = myobj1.ObjProp;
|
|
@@ -100,7 +100,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual(obj1, res.Tuple[1].UserData.Object);
|
|
Assert.AreEqual(obj1, res.Tuple[1].UserData.Object);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_IntPropertySetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_IntPropertySetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
myobj.IntProp = 19;";
|
|
myobj.IntProp = 19;";
|
|
@@ -120,7 +120,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual(19, obj.IntProp);
|
|
Assert.AreEqual(19, obj.IntProp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_NIntPropertySetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_NIntPropertySetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
myobj1.NIntProp = nil;
|
|
myobj1.NIntProp = nil;
|
|
@@ -145,7 +145,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual(19, obj2.NIntProp);
|
|
Assert.AreEqual(19, obj2.NIntProp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_ObjPropertySetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_ObjPropertySetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
myobj1.ObjProp = myobj2;
|
|
myobj1.ObjProp = myobj2;
|
|
@@ -170,7 +170,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual("hello", obj2.ObjProp);
|
|
Assert.AreEqual("hello", obj2.ObjProp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_InvalidPropertySetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_InvalidPropertySetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
myobj.IntProp = '19';";
|
|
myobj.IntProp = '19';";
|
|
@@ -190,7 +190,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual(19, obj.IntProp);
|
|
Assert.AreEqual(19, obj.IntProp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_StaticPropertyAccess(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_StaticPropertyAccess(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
static.StaticProp = 'asdasd' .. static.StaticProp;";
|
|
static.StaticProp = 'asdasd' .. static.StaticProp;";
|
|
@@ -210,7 +210,7 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
Assert.AreEqual("asdasdqweqwe", SomeClass.StaticProp);
|
|
Assert.AreEqual("asdasdqweqwe", SomeClass.StaticProp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void Test_IteratorPropertyGetter(UserDataAccessMode opt)
|
|
|
|
|
|
|
+ public void Test_IteratorPropertyGetter(InteropAccessMode opt)
|
|
|
{
|
|
{
|
|
|
string script = @"
|
|
string script = @"
|
|
|
x = 0;
|
|
x = 0;
|
|
@@ -237,109 +237,109 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IntPropertyGetter_None()
|
|
public void Interop_IntPropertyGetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_IntPropertyGetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_IntPropertyGetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IntPropertyGetter_Lazy()
|
|
public void Interop_IntPropertyGetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_IntPropertyGetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_IntPropertyGetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IntPropertyGetter_Precomputed()
|
|
public void Interop_IntPropertyGetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_IntPropertyGetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_IntPropertyGetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_NIntPropertyGetter_None()
|
|
public void Interop_NIntPropertyGetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_NIntPropertyGetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_NIntPropertyGetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_NIntPropertyGetter_Lazy()
|
|
public void Interop_NIntPropertyGetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_NIntPropertyGetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_NIntPropertyGetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_NIntPropertyGetter_Precomputed()
|
|
public void Interop_NIntPropertyGetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_NIntPropertyGetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_NIntPropertyGetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_ObjPropertyGetter_None()
|
|
public void Interop_ObjPropertyGetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_ObjPropertyGetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_ObjPropertyGetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_ObjPropertyGetter_Lazy()
|
|
public void Interop_ObjPropertyGetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_ObjPropertyGetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_ObjPropertyGetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_ObjPropertyGetter_Precomputed()
|
|
public void Interop_ObjPropertyGetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_ObjPropertyGetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_ObjPropertyGetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IntPropertySetter_None()
|
|
public void Interop_IntPropertySetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_IntPropertySetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_IntPropertySetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IntPropertySetter_Lazy()
|
|
public void Interop_IntPropertySetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_IntPropertySetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_IntPropertySetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IntPropertySetter_Precomputed()
|
|
public void Interop_IntPropertySetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_IntPropertySetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_IntPropertySetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_NIntPropertySetter_None()
|
|
public void Interop_NIntPropertySetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_NIntPropertySetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_NIntPropertySetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_NIntPropertySetter_Lazy()
|
|
public void Interop_NIntPropertySetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_NIntPropertySetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_NIntPropertySetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_NIntPropertySetter_Precomputed()
|
|
public void Interop_NIntPropertySetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_NIntPropertySetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_NIntPropertySetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_ObjPropertySetter_None()
|
|
public void Interop_ObjPropertySetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_ObjPropertySetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_ObjPropertySetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_ObjPropertySetter_Lazy()
|
|
public void Interop_ObjPropertySetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_ObjPropertySetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_ObjPropertySetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_ObjPropertySetter_Precomputed()
|
|
public void Interop_ObjPropertySetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_ObjPropertySetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_ObjPropertySetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -347,58 +347,58 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
|
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
|
public void Interop_InvalidPropertySetter_None()
|
|
public void Interop_InvalidPropertySetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_InvalidPropertySetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_InvalidPropertySetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
|
public void Interop_InvalidPropertySetter_Lazy()
|
|
public void Interop_InvalidPropertySetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_InvalidPropertySetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_InvalidPropertySetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
[ExpectedException(typeof(ScriptRuntimeException))]
|
|
|
public void Interop_InvalidPropertySetter_Precomputed()
|
|
public void Interop_InvalidPropertySetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_InvalidPropertySetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_InvalidPropertySetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_StaticPropertyAccess_None()
|
|
public void Interop_StaticPropertyAccess_None()
|
|
|
{
|
|
{
|
|
|
- Test_StaticPropertyAccess(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_StaticPropertyAccess(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_StaticPropertyAccess_Lazy()
|
|
public void Interop_StaticPropertyAccess_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_StaticPropertyAccess(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_StaticPropertyAccess(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_StaticPropertyAccess_Precomputed()
|
|
public void Interop_StaticPropertyAccess_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_StaticPropertyAccess(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_StaticPropertyAccess(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IteratorPropertyGetter_None()
|
|
public void Interop_IteratorPropertyGetter_None()
|
|
|
{
|
|
{
|
|
|
- Test_IteratorPropertyGetter(UserDataAccessMode.Reflection);
|
|
|
|
|
|
|
+ Test_IteratorPropertyGetter(InteropAccessMode.Reflection);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IteratorPropertyGetter_Lazy()
|
|
public void Interop_IteratorPropertyGetter_Lazy()
|
|
|
{
|
|
{
|
|
|
- Test_IteratorPropertyGetter(UserDataAccessMode.LazyOptimized);
|
|
|
|
|
|
|
+ Test_IteratorPropertyGetter(InteropAccessMode.LazyOptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|
|
|
public void Interop_IteratorPropertyGetter_Precomputed()
|
|
public void Interop_IteratorPropertyGetter_Precomputed()
|
|
|
{
|
|
{
|
|
|
- Test_IteratorPropertyGetter(UserDataAccessMode.Preoptimized);
|
|
|
|
|
|
|
+ Test_IteratorPropertyGetter(InteropAccessMode.Preoptimized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
[Test]
|