Example #1
0
 public void Indent()
 {
     pp = new PrettyPrinter(sw, 4);
     PrettyPrint("a$tb$oc$od$oe$of$og");
     Assert.AreEqual("abcd" + nl + "  ef" + nl + "  g", sw.ToString());
 }
Example #2
0
 public void LongStringWithOptionalBreaks()
 {
     pp = new PrettyPrinter(sw, 4);
     PrettyPrint("a$ob$oc$od$oe");
     Assert.AreEqual("abcd" + nl + "e", sw.ToString());
 }
Example #3
0
 public void LongStringWithConnectedBreaks()
 {
     pp = new PrettyPrinter(sw, 4);
     PrettyPrint("a$cb$cc$cd$ce");
     Assert.AreEqual("a" + nl + "b" + nl + "c" + nl + "d" + nl + "e", sw.ToString());
 }
Example #4
0
 public void ShortStringWithConnectedBreaks()
 {
     pp = new PrettyPrinter(sw, 4);
     PrettyPrint("a$cb");
     Assert.AreEqual("ab", sw.ToString());
 }
Example #5
0
 public void SmallString()
 {
     pp = new PrettyPrinter(sw, 4);
     PrettyPrint("hi");
     Assert.AreEqual("hi", sw.ToString());
 }
Example #6
0
 public JsonWriter(TextWriter w)
 {
     this.pp    = new PrettyPrinter(w, 120);
     this.state = new Stack <int>();
 }