public virtual void AddFirst() { TokenQueue tq = new TokenQueue("One Two"); tq.ConsumeWord(); tq.AddFirst("Three"); NUnit.Framework.Assert.AreEqual("Three Two", tq.Remainder()); }
public virtual void ChompBalancedMatchesAsMuchAsPossible() { TokenQueue tq = new TokenQueue("unbalanced(something(or another"); tq.ConsumeTo("("); String match = tq.ChompBalanced('(', ')'); NUnit.Framework.Assert.AreEqual("something(or another", match); }
public virtual void ChompToIgnoreCase() { String t = "<textarea>one < two </TEXTarea>"; TokenQueue tq = new TokenQueue(t); String data = tq.ChompToIgnoreCase("</textarea"); NUnit.Framework.Assert.AreEqual("<textarea>one < two ", data); tq = new TokenQueue("<textarea> one two < three </oops>"); data = tq.ChompToIgnoreCase("</textarea"); NUnit.Framework.Assert.AreEqual("<textarea> one two < three </oops>", data); }
public virtual void ChompBalanced() { TokenQueue tq = new TokenQueue(":contains(one (two) three) four"); String pre = tq.ConsumeTo("("); String guts = tq.ChompBalanced('(', ')'); String remainder = tq.Remainder(); NUnit.Framework.Assert.AreEqual(":contains", pre); NUnit.Framework.Assert.AreEqual("one (two) three", guts); NUnit.Framework.Assert.AreEqual(" four", remainder); }
public virtual void Unescape() { NUnit.Framework.Assert.AreEqual("one ( ) \\", TokenQueue.Unescape("one \\( \\) \\\\")); }