From 4cd3d045d1cc4692e38adfaea6e88758aa8568d5 Mon Sep 17 00:00:00 2001 From: Alexandre Mutel Date: Thu, 16 Jun 2016 10:03:04 +0900 Subject: [PATCH] Add tests precise position with text containing tabs --- src/Markdig.Tests/TestSourcePosition.cs | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/Markdig.Tests/TestSourcePosition.cs b/src/Markdig.Tests/TestSourcePosition.cs index e47773c43..8f485fd59 100644 --- a/src/Markdig.Tests/TestSourcePosition.cs +++ b/src/Markdig.Tests/TestSourcePosition.cs @@ -573,6 +573,43 @@ public void TestIndentedCode() "); } + [Test] + public void TestIndentedCodeWithTabs() + { + // 01 2 3 45 6 78 + Check("0\n\n\t0\n\t1\n", @" +paragraph ( 0, 0) 0-0 +literal ( 0, 0) 0-0 +code ( 2, 4) 4-7 +"); + } + + [Test] + public void TestIndentedCodeWithMixedTabs() + { + // 01 2 34 56 78 9 + Check("0\n\n \t0\n \t1\n", @" +paragraph ( 0, 0) 0-0 +literal ( 0, 0) 0-0 +code ( 2, 4) 5-9 +"); + } + + [Test] + public void TestTabsInList() + { + // 012 34 567 89 + Check("- \t0\n- \t1\n", @" +list ( 0, 0) 0-8 +listitem ( 0, 0) 0-3 +paragraph ( 0, 4) 3-3 +literal ( 0, 4) 3-3 +listitem ( 1, 0) 5-8 +paragraph ( 1, 4) 8-8 +literal ( 1, 4) 8-8 +"); + } + [Test] public void TestDocument() {