예제 #1
0
        public void OverlyLongLinesWithLeadingZeroWidth()
        {
            var @out        = new AppendableStringBuilder();
            var lineWrapper = new LineWrapper(@out, "  ", 10);

            lineWrapper.ZeroWidthSpace(2);
            lineWrapper.Append("abcdefghijkl");
            lineWrapper.Close();
            Assert.AreEqual("abcdefghijkl", @out.ToString());
        }
예제 #2
0
        public void NospaceWrapMax()
        {
            var @out        = new AppendableStringBuilder();
            var lineWrapper = new LineWrapper(@out, "  ", 10);

            lineWrapper.Append("abcde");
            lineWrapper.ZeroWidthSpace(2);
            lineWrapper.Append("fghijk");
            lineWrapper.Close();
            Assert.AreEqual("abcde\n    fghijk", @out.ToString());
        }
예제 #3
0
        public void wrapEmbeddedNewlines_ZeroWidth()
        {
            var @out        = new AppendableStringBuilder();
            var lineWrapper = new LineWrapper(@out, "  ", 10);

            lineWrapper.Append("abcde");
            lineWrapper.ZeroWidthSpace(2);
            lineWrapper.Append("fghijk\nlmn");
            lineWrapper.Append("opqrstuvwxy");
            lineWrapper.Close();
            Assert.AreEqual("abcde\n    fghijk\nlmnopqrstuvwxy", @out.ToString());
        }
예제 #4
0
        public void FencepostZeroWidth()
        {
            var @out        = new AppendableStringBuilder();
            var lineWrapper = new LineWrapper(@out, "  ", 10);

            lineWrapper.Append("abcde");
            lineWrapper.Append("fghij");
            lineWrapper.ZeroWidthSpace(2);
            lineWrapper.Append("k");
            lineWrapper.Append("lmnop");
            lineWrapper.Close();
            Assert.AreEqual("abcdefghij\n    klmnop", @out.ToString());
        }