예제 #1
0
		public void ReadAndPeek()
		{
			StringScanner scanner = new StringScanner(Text);
			int i=0;

			while (!scanner.AtEnd)
			{
				Assert.Less(i, Text.Length);
				Assert.AreEqual(Text[i], scanner.Peek());
				scanner.Read();
				++i;
			}

			Assert.AreEqual(Text.Length, i);
		}
예제 #2
0
		public void Offset_NotIncrementedAfterPeek()
		{
			StringScanner scanner = new StringScanner(Text);
			scanner.Peek();
			Assert.AreEqual(0, scanner.Offset);

		}
예제 #3
0
		public void Peek_AtEnd_NullChar()
		{
			StringScanner scanner = new StringScanner(Text);
			scanner.Seek(Text.Length);
			Assert.IsTrue(scanner.AtEnd);
			Assert.AreEqual('\0', scanner.Peek());
		}