public void BasicTest() { var lb = new LineBuffer(); lb.Add('1'); lb.Add('2'); lb.Line.Should().Be("12"); }
public void MatchOnCharByChar() { var l = new LineBuffer(); l.Add("b"); l.Add("a"); Assert.IsFalse(l.Match("bash")); l.Add("s"); l.Add("h"); Assert.IsTrue(l.Match("bash")); }
public void ReplaceLastSegmentTest() { var lb = new LineBuffer(); lb.Add('1'); lb.Add('2'); lb.Add(' '); lb.Add('4'); lb.Add('5'); lb.Line.Should().Be("12 45"); lb.ReplaceLastSegment("abcde"); lb.Line.Should().Be("12 abcde"); }
public void MissMatchOnNewLine() { var l = new LineBuffer(); l.Add("bash" + CrLf + "dude"); Assert.IsFalse(l.Match("bash")); }
public void SimpleMatchWithExtra() { var l = new LineBuffer(); l.Add("bogusbashdude"); Assert.IsTrue(l.Match("bash")); }
public void SimpleMatch() { var l = new LineBuffer(); l.Add("bash"); Assert.IsTrue(l.Match("bash")); }
public void ReplaceTest() { var lb = new LineBuffer(); lb.Add('1'); lb.Add('2'); lb.Add('3'); lb.Add('4'); lb.Add('5'); lb.Back(); lb.Line.Should().Be("12345"); lb.LineToCur.Should().Be("1234"); lb.Replace("abcde"); lb.Line.Should().Be("abcde"); lb.LineToCur.Should().Be("abcde"); }
public void Flush(LineBuffer b) { foreach (TextElem e in this) { b.Add(e); } Clear(); }
private void DrawLine(PointF[] points, int offset, int count) { if (!_lineBuffer.CanAdd(points, offset)) { CommitLine(); } _lineBuffer.Add(points, offset, count); }
public void BackspaceTest() { var lb = new LineBuffer(); lb.Add('1'); lb.Add('2'); lb.Add('3'); lb.Add('4'); lb.Add('5'); lb.Backspace(); lb.Line.Should().Be("1234"); lb.LineToCur.Should().Be("1234"); lb.Back(); lb.Back(); lb.LineToCur.Should().Be("12"); lb.Backspace(); lb.Line.Should().Be("134"); lb.LineToCur.Should().Be("1"); }
public void BackForwardEditTest() { var lb = new LineBuffer(); lb.Add('1'); lb.Add('2'); lb.Add('3'); lb.Add('4'); lb.Add('5'); lb.Back(); lb.Back(); lb.Back(); lb.Back(); lb.LineToCur.Should().Be("1"); lb.Add('a'); lb.Line.Should().Be("1a345"); lb.LineToCur.Should().Be("1a"); lb.Forward(); lb.LineToCur.Should().Be("1a3"); lb.Add('b'); lb.Line.Should().Be("1a3b5"); }