private static void Main() { var instance = new MobLang.Program(); instance.Writer += Console.WriteLine; instance.AddStd(); instance.AddImpure(); while (true) { Console.Write(@"> "); var builder = new StringBuilder(); string line; do { line = Console.ReadLine(); builder.Append(line); } while (line != ""); var input = builder.ToString(); instance.Execute(input, true); } }
public void TwoPlusTwo() { _sb.Clear(); _program.Execute("2 + 2", true); Assert.AreEqual("result : Int = 4", _sb.ToString()); }