Пример #1
0
        static void Test_PrevLineHead()
        {
            TextBuffer text = new TextBuffer(1, 32);

            text.Insert(0, TestData.ToCharArray());

            int i = 71;

            for ( ; 53 <= i; i--)
            {
                TestUtl.AssertEquals(53, LineLogic.PrevLineHead(text, i));
            }
            for ( ; 52 <= i; i--)
            {
                TestUtl.AssertEquals(52, LineLogic.PrevLineHead(text, i));
            }
            for ( ; 38 <= i; i--)
            {
                TestUtl.AssertEquals(38, LineLogic.PrevLineHead(text, i));
            }
            for ( ; 37 <= i; i--)
            {
                TestUtl.AssertEquals(37, LineLogic.PrevLineHead(text, i));
            }
            for ( ; 33 <= i; i--)
            {
                TestUtl.AssertEquals(33, LineLogic.PrevLineHead(text, i));
            }
            for ( ; 32 <= i; i--)
            {
                TestUtl.AssertEquals(32, LineLogic.PrevLineHead(text, i));
            }
            for ( ; 0 <= i; i--)
            {
                TestUtl.AssertEquals(0, LineLogic.PrevLineHead(text, i));
            }
        }