public void FollowingTextTest()
 {
     Assert.AreEqual("a...", ScriptPositionReporting.FollowingText("abc", 0, 1));
     Assert.AreEqual("bc", ScriptPositionReporting.FollowingText("abc", 1, 2));
     Assert.AreEqual("bc", ScriptPositionReporting.FollowingText("abc", 1, 10));
     Assert.AreEqual("", ScriptPositionReporting.FollowingText("abc", 3, 10));
 }
 public void FollowingTextTest_RemoveSeparators()
 {
     Assert.AreEqual("a b", ScriptPositionReporting.FollowingText("a\r\nb", 0, 5));
     Assert.AreEqual("a bbb...", ScriptPositionReporting.FollowingText("a\r\n\r\nbbbbbbbbbbb", 0, 5));
     Assert.AreEqual("b c", ScriptPositionReporting.FollowingText("a\t b\t c", 3, 5));
 }
 public void FollowingTextTest_LineColumn()
 {
     Assert.AreEqual("ab...", ScriptPositionReporting.FollowingText("abc\r\ndefgh", 1, 1, 2));
     Assert.AreEqual("ef...", ScriptPositionReporting.FollowingText("abc\r\ndefgh", 2, 2, 2));
 }
示例#4
0
        private string FollowingText_LineColumn(string script, int line, int column, int maxLength)
        {
            int position = ScriptPositionReporting.Position(script, line, column);

            return(ScriptPositionReporting.FollowingText(script, position, maxLength));
        }