From a638e6a885fb88b806b374639bbff0bec5952f17 Mon Sep 17 00:00:00 2001 From: Marco Mastropaolo Date: Thu, 9 Jul 2015 12:31:32 +0200 Subject: [PATCH] Version 0.9.8.0 --- .../EndToEnd/SimpleTests.cs | 18 ++++++++++++++++ .../EndToEnd/UserDataOverloadsTests.cs | 21 +++++++++++++++++++ .../CoreLib/OsTimeModule.cs | 2 +- src/MoonSharp.Interpreter/Script.cs | 2 +- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs index 57da276f..f47a0bed 100644 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs +++ b/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using MoonSharp.Interpreter.Execution; using NUnit.Framework; +using MoonSharp.Interpreter.Loaders; namespace MoonSharp.Interpreter.Tests { @@ -1474,5 +1475,22 @@ function test(a) "); } +// [Test] +// public void TestModulesLoadingWithoutCrash() +// { +//#if !PCL +// var basePath = AppDomain.CurrentDomain.BaseDirectory; +// var scriptPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "scripts\\test"); +// Script script = new Script(); + +// ((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new[] +// { +// System.IO.Path.Combine(basePath, "scripts\\test\\test.lua"), +// }; +// var obj = script.LoadFile(System.IO.Path.Combine(scriptPath, "test.lua")); +// obj.Function.Call(); +//#endif +// } + } } diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs index 052f5d08..144fb77e 100644 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs +++ b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs @@ -106,6 +106,27 @@ private void RunTestOverload(string code, string expected, bool tupleExpected = } + [Test] + public void Interop_OutParamInOverloadResolution() + { + UserData.RegisterType>(); + UserData.RegisterExtensionType(typeof(OverloadsExtMethods)); + + try + { + var lua = new Script(); + lua.Globals["DictionaryIntInt"] = typeof(Dictionary); + + var script = @"local dict = DictionaryIntInt.__new(); local res, v = dict.TryGetValue(0)"; + lua.DoString(script); + lua.DoString(script); + } + finally + { + UserData.UnregisterType>(); + } + } + [Test] public void Interop_Overloads_Varargs1() { diff --git a/src/MoonSharp.Interpreter/CoreLib/OsTimeModule.cs b/src/MoonSharp.Interpreter/CoreLib/OsTimeModule.cs index 587701f3..66d67433 100644 --- a/src/MoonSharp.Interpreter/CoreLib/OsTimeModule.cs +++ b/src/MoonSharp.Interpreter/CoreLib/OsTimeModule.cs @@ -166,7 +166,7 @@ private static string StrFTime(string format, DateTime d) { 'A', "dddd" }, { 'b', "MMM" }, { 'B', "MMMM" }, - { 'c', "%f" }, + { 'c', "f" }, { 'd', "dd" }, { 'D', "MM/dd/yy" }, { 'F', "yyyy-MM-dd" }, diff --git a/src/MoonSharp.Interpreter/Script.cs b/src/MoonSharp.Interpreter/Script.cs index f0d66dfb..dcd0937c 100644 --- a/src/MoonSharp.Interpreter/Script.cs +++ b/src/MoonSharp.Interpreter/Script.cs @@ -28,7 +28,7 @@ public class Script : IScriptPrivateResource /// /// The version of the MoonSharp engine /// - public const string VERSION = "0.9.7.1"; + public const string VERSION = "0.9.8.0"; /// /// The Lua version being supported