Skip to content

Commit

Permalink
Fix: Overloads (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
neolithos committed Jan 2, 2016
1 parent 1349670 commit f9cd9d5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
24 changes: 20 additions & 4 deletions ExtTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ namespace NeoTest1
// }
//}


public class Folder
{
public int SomeId { get; set; }
}

public class File
{
public Folder Folder { get; set; }
}

public class DynData : DynamicObject
{
public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
Expand Down Expand Up @@ -56,15 +67,20 @@ static void Main(string[] args)
{
//Console.WriteLine(TestAsync().Result);

TestDynamic();

//LinqTest2();
Console.ReadKey();
}

private static void TestDynamic()
{
var lua = new Lua();
var global = new LuaGlobalPortable(lua) { ["workspace"] = new DynData() };

var r= global.DoChunk("return workspace.Part", "Test.lua");
var r = global.DoChunk("return workspace.Part", "Test.lua");

Console.WriteLine(r.ToString());

//LinqTest2();
Console.ReadKey();
}

private static void Test()
Expand Down
24 changes: 24 additions & 0 deletions NeoLua.Test/LuaType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,30 @@ public void OverloadTest04()
"return #utf8:GetBytes('hi');"), 2);
}

[TestMethod]
public void OverloadTest05()
{
TestCode(Lines(
"line = clr.System.String[]('Hallo', 'Welt', '!!!');",
"return clr.System.String:Join(' ', line);"), "Hallo Welt !!!");
}

[TestMethod]
public void OverloadTest06()
{
TestCode(Lines(
"local function line() return 'Hallo', 'Welt', '!!!'; end;",
"return clr.System.String:Join(' ', line());"), "Hallo Welt !!!");
}

[TestMethod]
public void OverloadTest07()
{
TestCode(Lines(
"local function line() return 'Hallo', 'Welt', '!!!'; end;",
"return clr.System.String:Format('{0} {1} {2}', line());"), "Hallo Welt !!!");
}

[TestMethod]
public void ExtensionTest01()
{
Expand Down
2 changes: 1 addition & 1 deletion NeoLua/Properties/AssemblyInfoGlobal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
[assembly: AssemblyTrademark("")]

[assembly: AssemblyVersion("5.3.0.0")]
[assembly: AssemblyFileVersion("1.1.3.0")]
[assembly: AssemblyFileVersion("1.1.4.0")]
[assembly: AssemblyConfiguration("")]
//[assembly: AssemblyConfiguration("beta")]

0 comments on commit f9cd9d5

Please sign in to comment.