public void TokenRecognizedCorrectly(string input, string tokenName) { var skaner = new LispScaner(input); var result = skaner.TokenizeInput(); Assert.IsTrue(result.Count == 1); Assert.IsTrue(result.FirstOrDefault()?.GetKeyWordName() == tokenName); }
public void TokenRecognizedCorrectly(string input) { var skaner = new LispScaner(input); var result = skaner.TokenizeInput(); var parsed = Parser.Parse(result); Assert.IsTrue(parsed); }
public void TokenRecognizedCorrectly(string input, string expectedCode) { var skaner = new LispScaner(input); var tokenized = skaner.TokenizeInput(); Parser.Parse(tokenized); var generated = CodeGenerator.GenerateCode().Replace("\n", String.Empty).Replace("\r", String.Empty).Replace("\t", String.Empty); Assert.True(generated == expectedCode); }