public void Analyze_OK01() { const string text = " service test\r\n {\r\n rpc test1 (test2) returns (test3);\r\n}\r\n"; var lex = new Lexer(text); lex.Analyze(); Assert.AreEqual(7, lex.Tokens.Count); Assert.AreEqual(0, lex.Errors.Count); Assert.AreEqual(18, lex.Index); }
public void Analyze_NOK01() { const string text = "\r\n service test\r\n {\r\n rpx test1 (test2) returns (test3);\r\n}\r\n" + // rpx instead of rpc " service test\r\n {\r\n rpc test1 (test2) returns (test3);\r\n}\r\n"; var lex = new Lexer(text); lex.Analyze(); Assert.AreEqual(9, lex.Tokens.Count); Assert.AreEqual(11, lex.Errors.Count); Assert.AreEqual(37, lex.Index); }