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)"); }
public void OccursCheck() { _program.UnsafeExecute("def f x as x x"); }
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)"); }
public void Print() { _sb.Clear(); _program.UnsafeExecute("print (Just [42, -42], Nothing, [])"); Assert.AreEqual("(Just ([42, -42]), Nothing, [])", _sb.ToString()); }