Way better handling of calling functions from CSHarp

This commit is contained in:
2018-11-16 14:46:12 +01:00
parent 62ad100aee
commit 47e2dadb8d
8 changed files with 55 additions and 15 deletions

View File

@@ -151,5 +151,20 @@ a = 87
Assert.Equal(60, (long)(NumberLong)result);
}
[Fact]
public void ReturnFromCSharpCall()
{
const string input = @"
function testFunc ()
return 100
end
";
var script = new Script(input);
Assert.Empty(script.Diagnostics.Messages);
var result = script.EvaluateFunction<NumberLong>("testFunc");
Assert.Empty(script.Diagnostics.Messages);
Assert.Equal(100, (long)result);
}
}
}