public void TestSkipWhitespaces() { var text = new StringLineGroup(" ABC").ToCharIterator(); Assert.True(text.TrimStart()); Assert.AreEqual('A', text.CurrentChar); }
public void TestStringLineGroupWithTrim() { var line1 = new StringSlice(" ABC "); line1.NextChar(); line1.NextChar(); var line2 = new StringSlice(" DEF "); var text = new StringLineGroup(4) { line1, line2}.ToCharIterator(); text.TrimStart(); var result = ToString(text); TextAssert.AreEqual("ABC \n DEF ", result); }
public void TestSkipWhitespaces() { var text = new StringLineGroup(" ABC").ToCharIterator(); Assert.False(text.TrimStart()); Assert.AreEqual('A', text.CurrentChar); text = new StringLineGroup(" ").ToCharIterator(); Assert.True(text.TrimStart()); Assert.AreEqual('\0', text.CurrentChar); var slice = new StringSlice(" ABC"); Assert.False(slice.TrimStart()); slice = new StringSlice(" "); Assert.True(slice.TrimStart()); }