Fixes for function execution when parameter is not bound

This commit is contained in:
2019-01-20 15:17:06 +01:00
parent 3c0e5f5b13
commit 921abce011
3 changed files with 46 additions and 12 deletions

View File

@@ -43,6 +43,16 @@ namespace UpsilonTests.GeneralTests
return a + b;
}
public bool OverloadMethod(string s)
{
return s == "test";
}
public int OverloadMethod(int i)
{
return i + 10;
}
}
#pragma warning restore 414, 649
@@ -136,6 +146,20 @@ end
Assert.False(obj.PrivateSet);
}
[Fact]
public void OverloadMethods()
{
var obj = new UserDataHelper();
const string input = @"
function test(o)
return o.overloadMethod(""test"") and o.OverloadMethod(10) == 20
end
";
Assert.True(Executor.EvaluateFunction<bool>(input, "test", new[] {obj}, Options));
}
public UserDataTests(StaticScriptFixture fix) : base(fix)
{
}