Add unfolded generation of lua for better performance
This commit is contained in:
parent
aae20662e2
commit
3f0793ca22
42 changed files with 7629 additions and 325 deletions
37
AspectedRouting.Test/TypingTests.cs
Normal file
37
AspectedRouting.Test/TypingTests.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System.Linq;
|
||||
using AspectedRouting.Language;
|
||||
using AspectedRouting.Language.Typ;
|
||||
using Xunit;
|
||||
|
||||
namespace AspectedRouting.Test
|
||||
{
|
||||
public class TypingTests
|
||||
{
|
||||
|
||||
[Fact]
|
||||
public void JoinApply_Id()
|
||||
{
|
||||
var tp =
|
||||
new Curry(
|
||||
new Curry(
|
||||
new Var("x"), Typs.String
|
||||
), new Curry(
|
||||
new Var("x"), Typs.String
|
||||
)
|
||||
);
|
||||
Assert.Equal("($x -> string) -> $x -> string", tp.ToString());
|
||||
|
||||
/*
|
||||
* ($x -> string) -> $x -> string
|
||||
* ($a -> $a )
|
||||
* should give the unification table
|
||||
* ($x --> string)
|
||||
*/
|
||||
|
||||
var unificationTable = tp.ArgType.UnificationTable(Funcs.Id.Types.First());
|
||||
Assert.Equal("string", unificationTable["$a"].ToString());
|
||||
Assert.Equal("string", unificationTable["$x"].ToString());
|
||||
Assert.Equal(2, unificationTable.Count);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue