public void LFIsWhitespaceTest() { string line = "(parse-whitespace \"\n\" 0)"; string result = HighLevel.Evaluate(line, TraceLevel.Error, env); Assert.AreEqual("(1 \"Whitespace\" (1 \"LF\" \"\n\"))", result); }
public void TestMultOneArgument() { string expr = "(* 2)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("2", result); }
public void TestDivThreeArguments() { string expr = "(/ 8 2 2)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("2", result); }
public void TestParseStringSingleChar() { string line = "(parse-string \"String\" \"o\" \"Hello\" 4)"; string result = HighLevel.Evaluate(line, TraceLevel.Error, env); Assert.AreEqual("(5 \"String\" \"o\")", result); }
public void TestPlusMultilevel() { string expr = "(+ 1 (+ 1 1))"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("3", result); }
public void TestInc() { string line = "(inc 3)"; string result = HighLevel.Evaluate(line); Assert.AreEqual("4", result); }
public void TestParseStringRange() { string line = "(parse-string-range \"String\" \"A\" \"Z\" \"HEllo\" 0)"; string result = HighLevel.Evaluate(line, TraceLevel.Error, env); Assert.AreEqual("(2 \"String\" \"HE\")", result); }
public void TestUnwrapListTwoStrings() { string result = HighLevel.Evaluate("(list-unwrap (list \"Value1\" \"Value2\"))", TraceLevel.Error, env); Console.WriteLine(result); Assert.AreEqual("(\"Value1\" \"Value2\")", result); }
public void TestUnwrapEmptyList() { string result = HighLevel.Evaluate("(list-unwrap (NIL))", TraceLevel.Error, env); Console.WriteLine(result); Assert.AreEqual("NIL", result); }
public void CreateDictTest() { string input = "(dict)"; string result = HighLevel.Evaluate(input); Assert.AreEqual("(dict)", result); }
public void TestUnwrapString() { string result = HighLevel.Evaluate("(list-unwrap \"Value\")", TraceLevel.Error, env); Console.WriteLine(result); Assert.AreEqual("\"Value\"", result); }
public void GetKeysTest() { string input = "(keys-dict (add-dict (dict) \"Key\" \"Value\"))"; string result = HighLevel.Evaluate(input); Assert.AreEqual("(\"Key\" . NIL)", result); }
public void ReadDictTest() { string input = "(read-dict (add-dict (dict) \"Key\" \"Value\") \"Key\")"; string result = HighLevel.Evaluate(input); Assert.AreEqual("\"Value\"", result); }
public void AddDictTest() { string input = "(add-dict (dict) \"Key\" \"Value\")"; string result = HighLevel.Evaluate(input); Assert.AreEqual("(dict (\"Key\":\"Value\"))", result); }
public void TestSimpleEqualsTrue() { string expr = "(= 2 2)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("True", result); }
public void TestSquashSingleChild() { string result = HighLevel.Evaluate("(squash \"Y\" (quote (1 \"X\" (1 \"Y\" \"text\")) ))", TraceLevel.Error, env); Console.WriteLine(result); Assert.AreEqual("(1 \"X\" NIL)", result); }
public void TestSimpleLoop() { string line = "(loop print (list 1 2 3) )"; string result = HighLevel.Evaluate(line); Assert.AreEqual("NIL", result); }
public void TestSquashFirstChildHit() { string result = HighLevel.Evaluate("(squash \"Y\" (quote (10 \"X\" ((5 \"Y\" \"ytext\") (10 \"Z\" \"ztext\"))) ))", TraceLevel.Error, env); Console.WriteLine(result); Assert.AreEqual("(10 \"X\" (10 \"Z\" \"ztext\"))", result); }
public void TestDec() { string line = "(dec 3)"; string result = HighLevel.Evaluate(line); Assert.AreEqual("2", result); }
public void SimplePrintTest() { string input = "(print \"Hello\")"; string result = HighLevel.Evaluate(input); Assert.AreEqual("NIL", result); }
public void TestParseStringRangeNothingToParse() { string line = "(parse-string-range \"String\" \"a\" \"z\" \"HEllo\" 0)"; string result = HighLevel.Evaluate(line, TraceLevel.Error, env); Assert.AreEqual("NIL", result); }
public void TestQuoteEvaluationMacro() { string line = "(quote (inc 1))"; string result = HighLevel.Evaluate(line); Assert.AreEqual("(+ 1 1)", result); }
public void TestPlusFiveArguments() { string expr = "(+ 1 2 3 4 5)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("15", result); }
public void TestEvalQuoteEvaluation() { string expr = "(eval (quote (+ 5 4)))"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("9", result); }
public void TestMinusTwoArguments() { string expr = "(- 3 1)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("2", result); }
public void TestSimpleStringEqualsFalse() { string expr = "(= \"Hello\" \"Hi\")"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("False", result); }
public void TestMultThreeArguments() { string expr = "(* 3 4 5)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("60", result); }
public void TestSimpleGreaterFalse2() { string expr = "(> 3 3)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("False", result); }
public void TestPlusTwoArguments() { string expr = "(+ 1 2)"; string result = HighLevel.Evaluate(expr); Assert.AreEqual("3", result); }
public void TestSpaceParser() { string line = "(parse-char \"Space\" \" \" \"A B\" 1)"; string result = HighLevel.Evaluate(line, TraceLevel.Error, env); Assert.AreEqual("(2 \"Space\" \" \")", result); }