Esempio n. 1
0
        public void ContainsIgnoreCase()
        {
            CharacterReader r = new CharacterReader("One TWO three");

            Assert.IsTrue(r.ContainsIgnoreCase("two"));
            Assert.IsTrue(r.ContainsIgnoreCase("three"));
            // weird one: does not find one, because it scans for consistent case only
            Assert.IsFalse(r.ContainsIgnoreCase("one"));
        }
Esempio n. 2
0
 // no default, as covered with above consumeToAny
 // from < in rcdata
 internal override void Read(Tokeniser t, CharacterReader r)
 {
     if (r.Matches('/'))
     {
         t.CreateTempBuffer();
         t.AdvanceTransition(TokeniserState.RCDATAEndTagOpen);
     }
     else if (r.MatchesLetter() && t.AppropriateEndTagName() != null && !r.ContainsIgnoreCase("</" + t.AppropriateEndTagName()))
     {
         // diverge from spec: got a start tag, but there's no appropriate end tag (</title>), so rather than
         // consuming to EOF; break out here
         t.tagPending = new Token.EndTag(t.AppropriateEndTagName());
         t.EmitTagPending();
         r.Unconsume();
         // undo "<"
         t.Transition(TokeniserState.Data);
     }
     else
     {
         t.Emit("<");
         t.Transition(TokeniserState.Rcdata);
     }
 }