public void TestTokeniserOperators() { IdfToken tk = new IdfToken("+", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Operator); Assert.AreEqual(tk.Operator.Op, "+"); tk = new IdfToken("-", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Operator); Assert.AreEqual(tk.Operator.Op, "-"); tk = new IdfToken("*", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Operator); Assert.AreEqual(tk.Operator.Op, "*"); tk = new IdfToken("/", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Operator); Assert.AreEqual(tk.Operator.Op, "/"); tk = new IdfToken("and", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Operator); Assert.AreEqual(tk.Operator.Op, "and"); tk = new IdfToken("xor", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Operator); Assert.AreEqual(tk.Operator.Op, "xor"); }
public void TestTokeniserFunctions() { IdfToken tk = new IdfToken("formcfilter", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Function); tk = new IdfToken("acib", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Function); }
public void TestTokeniserLiterals() { IdfToken tk = new IdfToken("point1", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Literal); tk = new IdfToken("poiandt1", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Literal); tk = new IdfToken("andsksks", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Literal); tk = new IdfToken("ftojsjdand", operators, functions); Assert.AreEqual(tk.Type, IdfTokenType.Literal); }