示例#1
0
 public OutputlessTests()
 {
     _program = new MobLang.Program();
     _program.AddStd();
     _program.AddImpure();
     _program.UnsafeExecute("def undefined : undefined as undefined");
     _program.UnsafeExecute("def assert x as if not x then undefined");
     _program.UnsafeExecute("def assert_eq x y as assert (x == y)");
 }
示例#2
0
 public void OccursCheck()
 {
     _program.UnsafeExecute("def f x as x x");
 }
示例#3
0
 public void DataType()
 {
     _program.UnsafeExecute("data X a case X of Int -> Int case Y of (Int, Bool -> a)");
     _program.UnsafeExecute("X id");
     _program.UnsafeExecute("Y (42 + 12, id)");
 }
示例#4
0
 public void Print()
 {
     _sb.Clear();
     _program.UnsafeExecute("print (Just [42, -42], Nothing, [])");
     Assert.AreEqual("(Just ([42, -42]), Nothing, [])", _sb.ToString());
 }