From 22b3ce1ad686783bcac041b99aeaa844a57fdda7 Mon Sep 17 00:00:00 2001 From: Anton Sorokin Date: Thu, 13 Oct 2022 18:05:56 +0300 Subject: [PATCH 1/2] [#165] [#192] Add tests for specific cases Problem: there is no tests for links to directories and non-markdown files. Also we aren't testing that links are case sensetive Solution: add such tests to `check-local-refs`, also check that only links to directory are allowed to have trailing slash, e.g. `a.md/` is bad and `dir1/` is ok --- .../config-with-virtual-files.yaml | 1 + .../golden/check-local-refs/dir1/dir2/d2f1.md | 15 +++- .../check-local-refs/dir1/dir2/d2f3.yaml | 4 + tests/golden/check-local-refs/expected1.gold | 50 ++++++++++--- tests/golden/check-local-refs/expected2.gold | 74 ++++++++++++++++--- tests/golden/check-local-refs/expected3.gold | 58 ++++++++++++--- 6 files changed, 168 insertions(+), 34 deletions(-) create mode 100644 tests/golden/check-local-refs/dir1/dir2/d2f3.yaml diff --git a/tests/golden/check-local-refs/config-with-virtual-files.yaml b/tests/golden/check-local-refs/config-with-virtual-files.yaml index 9ca793f7..ff8bb2fb 100644 --- a/tests/golden/check-local-refs/config-with-virtual-files.yaml +++ b/tests/golden/check-local-refs/config-with-virtual-files.yaml @@ -6,6 +6,7 @@ verification: - ../d0f1.md - ../../a.md - b/../../* + - DIR2/ scanners: markdown: diff --git a/tests/golden/check-local-refs/dir1/dir2/d2f1.md b/tests/golden/check-local-refs/dir1/dir2/d2f1.md index fec7fa88..5e9a74ca 100644 --- a/tests/golden/check-local-refs/dir1/dir2/d2f1.md +++ b/tests/golden/check-local-refs/dir1/dir2/d2f1.md @@ -9,16 +9,23 @@ [bad-cf-ref](#bad) # Relative links -[existing-file-rel](d2f2.md) -[existing-file-rel](./d2f2.md) -[existing-file-rel](../dir2/.././d1f1.md) +[existing-file-rel-1](d2f2.md) +[existing-file-rel-2](./d2f2.md) +[existing-file-rel-3](../dir2/.././d1f1.md) +[existing-file-rel-4](d2f3.yaml) +[existing-dir-rel-1](..) +[existing-dir-rel-2](../dir2) +[existing-dir-rel-3](../dir2/) [existing-anchor-rel-1](d2f2.md#existing-anchor-d2f2) [existing-anchor-rel-2](./d2f2.md#existing-anchor-d2f2) [existing-anchor-rel-3](../dir2/../d1f1.md#existing-anchor-d1f1) [bad-file-rel](../a/b/c/unexisting-file.md) +[bad-slash-file-rel](d2f2.md/) +[bad-casing-file-rel](D2F2.md/) +[bad-casing-folder-rel](../DIR2) [bad-anchor-rel-1](d2f2.md#bad-anchor) [bad-anchor-rel-2](unexisting-file.md#bad-anchor) @@ -26,6 +33,8 @@ # Absolute links Should be correct when root is `/tests/golden/check-local-refs`: [file-abs-1](/dir1/./d1f1.md) +[folder-abs-1](/dir1) +[folder-abs-2](/dir1/dir2/../) [anchor-abs-1](/dir1/../dir1/d1f1.md#existing-anchor-d1f1) [anchor-abs-2](/dir1/dir2/../../dir1/./dir2/d2f2.md#existing-anchor-d2f2) Should be correct when root is `/tests/golden/check-local-refs/dir1`: diff --git a/tests/golden/check-local-refs/dir1/dir2/d2f3.yaml b/tests/golden/check-local-refs/dir1/dir2/d2f3.yaml new file mode 100644 index 00000000..e6dc3738 --- /dev/null +++ b/tests/golden/check-local-refs/dir1/dir2/d2f3.yaml @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2022 Serokell +# +# SPDX-License-Identifier: Unlicense +p: q diff --git a/tests/golden/check-local-refs/expected1.gold b/tests/golden/check-local-refs/expected1.gold index 287397ae..4ff28839 100644 --- a/tests/golden/check-local-refs/expected1.gold +++ b/tests/golden/check-local-refs/expected1.gold @@ -10,7 +10,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:21:1-43: + bad reference (relative) at src:25:1-43: - text: "bad-file-rel" - link: ../a/b/c/unexisting-file.md - anchor: - @@ -20,7 +20,37 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:23:1-38: + bad reference (relative) at src:26:1-30: + - text: "bad-slash-file-rel" + - link: d2f2.md/ + - anchor: - + + ⛀ File does not exist: + dir1/dir2/d2f2.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:27:1-31: + - text: "bad-casing-file-rel" + - link: D2F2.md/ + - anchor: - + + ⛀ File does not exist: + dir1/dir2/D2F2.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:28:1-32: + - text: "bad-casing-folder-rel" + - link: ../DIR2 + - anchor: - + + ⛀ File does not exist: + dir1/dir2/../DIR2 + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:30:1-38: - text: "bad-anchor-rel-1" - link: d2f2.md - anchor: bad-anchor @@ -29,7 +59,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:24:1-49: + bad reference (relative) at src:31:1-49: - text: "bad-anchor-rel-2" - link: unexisting-file.md - anchor: bad-anchor @@ -39,7 +69,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:32:1-22: + bad reference (absolute) at src:41:1-22: - text: "file-abs-2" - link: /d1f1.md - anchor: - @@ -49,7 +79,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:33:1-27: + bad reference (absolute) at src:42:1-27: - text: "file-abs-3" - link: /dir2/d2f2.md - anchor: - @@ -59,7 +89,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:34:1-32: + bad reference (absolute) at src:43:1-32: - text: "file-abs-4" - link: /./dir2/../d1f1.md - anchor: - @@ -69,7 +99,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:35:1-55: + bad reference (absolute) at src:44:1-55: - text: "anchor-abs-3" - link: /./dir2/../d1f1.md - anchor: existing-anchor-d1f1 @@ -79,7 +109,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:46:1-16: + bad reference (absolute) at src:55:1-16: - text: "A" - link: /../../a.md - anchor: - @@ -89,7 +119,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:47:1-18: + bad reference (absolute) at src:56:1-18: - text: "B" - link: /b/../../b.md - anchor: - @@ -98,4 +128,4 @@ ./b/../../b.md -Invalid references dumped, 10 in total. +Invalid references dumped, 13 in total. diff --git a/tests/golden/check-local-refs/expected2.gold b/tests/golden/check-local-refs/expected2.gold index cbfd3e57..d8e6bdd5 100644 --- a/tests/golden/check-local-refs/expected2.gold +++ b/tests/golden/check-local-refs/expected2.gold @@ -10,7 +10,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:21:1-43: + bad reference (relative) at src:25:1-43: - text: "bad-file-rel" - link: ../a/b/c/unexisting-file.md - anchor: - @@ -20,7 +20,37 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:23:1-38: + bad reference (relative) at src:26:1-30: + - text: "bad-slash-file-rel" + - link: d2f2.md/ + - anchor: - + + ⛀ File does not exist: + dir1/dir2/d2f2.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:27:1-31: + - text: "bad-casing-file-rel" + - link: D2F2.md/ + - anchor: - + + ⛀ File does not exist: + dir1/dir2/D2F2.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:28:1-32: + - text: "bad-casing-folder-rel" + - link: ../DIR2 + - anchor: - + + ⛀ File does not exist: + dir1/dir2/../DIR2 + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:30:1-38: - text: "bad-anchor-rel-1" - link: d2f2.md - anchor: bad-anchor @@ -29,7 +59,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:24:1-49: + bad reference (relative) at src:31:1-49: - text: "bad-anchor-rel-2" - link: unexisting-file.md - anchor: bad-anchor @@ -39,7 +69,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:28:1-29: + bad reference (absolute) at src:35:1-29: - text: "file-abs-1" - link: /dir1/./d1f1.md - anchor: - @@ -49,7 +79,27 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:29:1-58: + bad reference (absolute) at src:36:1-21: + - text: "folder-abs-1" + - link: /dir1 + - anchor: - + + ⛀ File does not exist: + dir1/dir1 + + + ➥ In file dir1/dir2/d2f1.md + bad reference (absolute) at src:37:1-30: + - text: "folder-abs-2" + - link: /dir1/dir2/../ + - anchor: - + + ⛀ File does not exist: + dir1/dir1/dir2/../ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (absolute) at src:38:1-58: - text: "anchor-abs-1" - link: /dir1/../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -59,7 +109,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:30:1-73: + bad reference (absolute) at src:39:1-73: - text: "anchor-abs-2" - link: /dir1/dir2/../../dir1/./dir2/d2f2.md - anchor: existing-anchor-d2f2 @@ -69,7 +119,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:40:1-42: + bad reference (relative) at src:49:1-42: - text: "path-through-top-dir" - link: ../../dir1/d1f1.md - anchor: - @@ -79,7 +129,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:41:1-75: + bad reference (relative) at src:50:1-75: - text: "path-through-top-dir-with-anchor" - link: ../../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -89,7 +139,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:42:1-26: + bad reference (relative) at src:51:1-26: - text: "ref-to-d0" - link: ../../d0f1.md - anchor: - @@ -99,7 +149,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:46:1-16: + bad reference (absolute) at src:55:1-16: - text: "A" - link: /../../a.md - anchor: - @@ -109,7 +159,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:47:1-18: + bad reference (absolute) at src:56:1-18: - text: "B" - link: /b/../../b.md - anchor: - @@ -118,4 +168,4 @@ dir1/b/../../b.md -Invalid references dumped, 12 in total. +Invalid references dumped, 17 in total. diff --git a/tests/golden/check-local-refs/expected3.gold b/tests/golden/check-local-refs/expected3.gold index 05c42c2b..ccbf2622 100644 --- a/tests/golden/check-local-refs/expected3.gold +++ b/tests/golden/check-local-refs/expected3.gold @@ -10,7 +10,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:21:1-43: + bad reference (relative) at src:25:1-43: - text: "bad-file-rel" - link: ../a/b/c/unexisting-file.md - anchor: - @@ -20,7 +20,27 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:23:1-38: + bad reference (relative) at src:26:1-30: + - text: "bad-slash-file-rel" + - link: d2f2.md/ + - anchor: - + + ⛀ File does not exist: + dir1/dir2/d2f2.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:27:1-31: + - text: "bad-casing-file-rel" + - link: D2F2.md/ + - anchor: - + + ⛀ File does not exist: + dir1/dir2/D2F2.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:30:1-38: - text: "bad-anchor-rel-1" - link: d2f2.md - anchor: bad-anchor @@ -29,7 +49,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:24:1-49: + bad reference (relative) at src:31:1-49: - text: "bad-anchor-rel-2" - link: unexisting-file.md - anchor: bad-anchor @@ -39,7 +59,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:28:1-29: + bad reference (absolute) at src:35:1-29: - text: "file-abs-1" - link: /dir1/./d1f1.md - anchor: - @@ -49,7 +69,27 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:29:1-58: + bad reference (absolute) at src:36:1-21: + - text: "folder-abs-1" + - link: /dir1 + - anchor: - + + ⛀ File does not exist: + dir1/dir1 + + + ➥ In file dir1/dir2/d2f1.md + bad reference (absolute) at src:37:1-30: + - text: "folder-abs-2" + - link: /dir1/dir2/../ + - anchor: - + + ⛀ File does not exist: + dir1/dir1/dir2/../ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (absolute) at src:38:1-58: - text: "anchor-abs-1" - link: /dir1/../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -59,7 +99,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:30:1-73: + bad reference (absolute) at src:39:1-73: - text: "anchor-abs-2" - link: /dir1/dir2/../../dir1/./dir2/d2f2.md - anchor: existing-anchor-d2f2 @@ -69,7 +109,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:40:1-42: + bad reference (relative) at src:49:1-42: - text: "path-through-top-dir" - link: ../../dir1/d1f1.md - anchor: - @@ -79,7 +119,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:41:1-75: + bad reference (relative) at src:50:1-75: - text: "path-through-top-dir-with-anchor" - link: ../../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -88,4 +128,4 @@ dir1/dir2/../../dir1/d1f1.md -Invalid references dumped, 9 in total. +Invalid references dumped, 13 in total. From a03c9fff2afffd535241b75bd6885ad262c65303 Mon Sep 17 00:00:00 2001 From: Anton Sorokin Date: Fri, 14 Oct 2022 15:19:05 +0300 Subject: [PATCH 2/2] fixup! [#165] [#192] Add tests for specific cases --- .../golden/check-local-refs/dir1/dir2/d2f1.md | 7 ++- tests/golden/check-local-refs/expected1.gold | 48 +++++++++------- tests/golden/check-local-refs/expected2.gold | 56 +++++++++++-------- tests/golden/check-local-refs/expected3.gold | 48 +++++++++------- 4 files changed, 97 insertions(+), 62 deletions(-) diff --git a/tests/golden/check-local-refs/dir1/dir2/d2f1.md b/tests/golden/check-local-refs/dir1/dir2/d2f1.md index 5e9a74ca..59db4749 100644 --- a/tests/golden/check-local-refs/dir1/dir2/d2f1.md +++ b/tests/golden/check-local-refs/dir1/dir2/d2f1.md @@ -14,6 +14,11 @@ [existing-file-rel-3](../dir2/.././d1f1.md) [existing-file-rel-4](d2f3.yaml) +Currently our behavior is wrong, see https://github.com/serokell/xrefcheck/issues/195 +[slash-file-rel](d2f2.md/) + + + [existing-dir-rel-1](..) [existing-dir-rel-2](../dir2) [existing-dir-rel-3](../dir2/) @@ -23,7 +28,6 @@ [existing-anchor-rel-3](../dir2/../d1f1.md#existing-anchor-d1f1) [bad-file-rel](../a/b/c/unexisting-file.md) -[bad-slash-file-rel](d2f2.md/) [bad-casing-file-rel](D2F2.md/) [bad-casing-folder-rel](../DIR2) @@ -41,6 +45,7 @@ Should be correct when root is `/tests/golden/check-local-refs/dir1`: [file-abs-2](/d1f1.md) [file-abs-3](/dir2/d2f2.md) [file-abs-4](/./dir2/../d1f1.md) +[file-abs-slash](/./dir2/../d1f1.md/) [anchor-abs-3](/./dir2/../d1f1.md#existing-anchor-d1f1) # Test references outside repo diff --git a/tests/golden/check-local-refs/expected1.gold b/tests/golden/check-local-refs/expected1.gold index 4ff28839..219ed54a 100644 --- a/tests/golden/check-local-refs/expected1.gold +++ b/tests/golden/check-local-refs/expected1.gold @@ -10,27 +10,27 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:25:1-43: - - text: "bad-file-rel" - - link: ../a/b/c/unexisting-file.md + bad reference (relative) at src:18:1-26: + - text: "slash-file-rel" + - link: d2f2.md/ - anchor: - ⛀ File does not exist: - dir1/dir2/../a/b/c/unexisting-file.md + dir1/dir2/d2f2.md/ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:26:1-30: - - text: "bad-slash-file-rel" - - link: d2f2.md/ + bad reference (relative) at src:30:1-43: + - text: "bad-file-rel" + - link: ../a/b/c/unexisting-file.md - anchor: - ⛀ File does not exist: - dir1/dir2/d2f2.md/ + dir1/dir2/../a/b/c/unexisting-file.md ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:27:1-31: + bad reference (relative) at src:31:1-31: - text: "bad-casing-file-rel" - link: D2F2.md/ - anchor: - @@ -40,7 +40,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:28:1-32: + bad reference (relative) at src:32:1-32: - text: "bad-casing-folder-rel" - link: ../DIR2 - anchor: - @@ -50,7 +50,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:30:1-38: + bad reference (relative) at src:34:1-38: - text: "bad-anchor-rel-1" - link: d2f2.md - anchor: bad-anchor @@ -59,7 +59,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:31:1-49: + bad reference (relative) at src:35:1-49: - text: "bad-anchor-rel-2" - link: unexisting-file.md - anchor: bad-anchor @@ -69,7 +69,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:41:1-22: + bad reference (absolute) at src:45:1-22: - text: "file-abs-2" - link: /d1f1.md - anchor: - @@ -79,7 +79,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:42:1-27: + bad reference (absolute) at src:46:1-27: - text: "file-abs-3" - link: /dir2/d2f2.md - anchor: - @@ -89,7 +89,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:43:1-32: + bad reference (absolute) at src:47:1-32: - text: "file-abs-4" - link: /./dir2/../d1f1.md - anchor: - @@ -99,7 +99,17 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:44:1-55: + bad reference (absolute) at src:48:1-37: + - text: "file-abs-slash" + - link: /./dir2/../d1f1.md/ + - anchor: - + + ⛀ File does not exist: + ././dir2/../d1f1.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (absolute) at src:49:1-55: - text: "anchor-abs-3" - link: /./dir2/../d1f1.md - anchor: existing-anchor-d1f1 @@ -109,7 +119,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:55:1-16: + bad reference (absolute) at src:60:1-16: - text: "A" - link: /../../a.md - anchor: - @@ -119,7 +129,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:56:1-18: + bad reference (absolute) at src:61:1-18: - text: "B" - link: /b/../../b.md - anchor: - @@ -128,4 +138,4 @@ ./b/../../b.md -Invalid references dumped, 13 in total. +Invalid references dumped, 14 in total. diff --git a/tests/golden/check-local-refs/expected2.gold b/tests/golden/check-local-refs/expected2.gold index d8e6bdd5..9bb2c96e 100644 --- a/tests/golden/check-local-refs/expected2.gold +++ b/tests/golden/check-local-refs/expected2.gold @@ -10,27 +10,27 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:25:1-43: - - text: "bad-file-rel" - - link: ../a/b/c/unexisting-file.md + bad reference (relative) at src:18:1-26: + - text: "slash-file-rel" + - link: d2f2.md/ - anchor: - ⛀ File does not exist: - dir1/dir2/../a/b/c/unexisting-file.md + dir1/dir2/d2f2.md/ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:26:1-30: - - text: "bad-slash-file-rel" - - link: d2f2.md/ + bad reference (relative) at src:30:1-43: + - text: "bad-file-rel" + - link: ../a/b/c/unexisting-file.md - anchor: - ⛀ File does not exist: - dir1/dir2/d2f2.md/ + dir1/dir2/../a/b/c/unexisting-file.md ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:27:1-31: + bad reference (relative) at src:31:1-31: - text: "bad-casing-file-rel" - link: D2F2.md/ - anchor: - @@ -40,7 +40,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:28:1-32: + bad reference (relative) at src:32:1-32: - text: "bad-casing-folder-rel" - link: ../DIR2 - anchor: - @@ -50,7 +50,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:30:1-38: + bad reference (relative) at src:34:1-38: - text: "bad-anchor-rel-1" - link: d2f2.md - anchor: bad-anchor @@ -59,7 +59,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:31:1-49: + bad reference (relative) at src:35:1-49: - text: "bad-anchor-rel-2" - link: unexisting-file.md - anchor: bad-anchor @@ -69,7 +69,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:35:1-29: + bad reference (absolute) at src:39:1-29: - text: "file-abs-1" - link: /dir1/./d1f1.md - anchor: - @@ -79,7 +79,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:36:1-21: + bad reference (absolute) at src:40:1-21: - text: "folder-abs-1" - link: /dir1 - anchor: - @@ -89,7 +89,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:37:1-30: + bad reference (absolute) at src:41:1-30: - text: "folder-abs-2" - link: /dir1/dir2/../ - anchor: - @@ -99,7 +99,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:38:1-58: + bad reference (absolute) at src:42:1-58: - text: "anchor-abs-1" - link: /dir1/../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -109,7 +109,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:39:1-73: + bad reference (absolute) at src:43:1-73: - text: "anchor-abs-2" - link: /dir1/dir2/../../dir1/./dir2/d2f2.md - anchor: existing-anchor-d2f2 @@ -119,7 +119,17 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:49:1-42: + bad reference (absolute) at src:48:1-37: + - text: "file-abs-slash" + - link: /./dir2/../d1f1.md/ + - anchor: - + + ⛀ File does not exist: + dir1/./dir2/../d1f1.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:54:1-42: - text: "path-through-top-dir" - link: ../../dir1/d1f1.md - anchor: - @@ -129,7 +139,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:50:1-75: + bad reference (relative) at src:55:1-75: - text: "path-through-top-dir-with-anchor" - link: ../../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -139,7 +149,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:51:1-26: + bad reference (relative) at src:56:1-26: - text: "ref-to-d0" - link: ../../d0f1.md - anchor: - @@ -149,7 +159,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:55:1-16: + bad reference (absolute) at src:60:1-16: - text: "A" - link: /../../a.md - anchor: - @@ -159,7 +169,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:56:1-18: + bad reference (absolute) at src:61:1-18: - text: "B" - link: /b/../../b.md - anchor: - @@ -168,4 +178,4 @@ dir1/b/../../b.md -Invalid references dumped, 17 in total. +Invalid references dumped, 18 in total. diff --git a/tests/golden/check-local-refs/expected3.gold b/tests/golden/check-local-refs/expected3.gold index ccbf2622..94b997c0 100644 --- a/tests/golden/check-local-refs/expected3.gold +++ b/tests/golden/check-local-refs/expected3.gold @@ -10,27 +10,27 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:25:1-43: - - text: "bad-file-rel" - - link: ../a/b/c/unexisting-file.md + bad reference (relative) at src:18:1-26: + - text: "slash-file-rel" + - link: d2f2.md/ - anchor: - ⛀ File does not exist: - dir1/dir2/../a/b/c/unexisting-file.md + dir1/dir2/d2f2.md/ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:26:1-30: - - text: "bad-slash-file-rel" - - link: d2f2.md/ + bad reference (relative) at src:30:1-43: + - text: "bad-file-rel" + - link: ../a/b/c/unexisting-file.md - anchor: - ⛀ File does not exist: - dir1/dir2/d2f2.md/ + dir1/dir2/../a/b/c/unexisting-file.md ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:27:1-31: + bad reference (relative) at src:31:1-31: - text: "bad-casing-file-rel" - link: D2F2.md/ - anchor: - @@ -40,7 +40,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:30:1-38: + bad reference (relative) at src:34:1-38: - text: "bad-anchor-rel-1" - link: d2f2.md - anchor: bad-anchor @@ -49,7 +49,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:31:1-49: + bad reference (relative) at src:35:1-49: - text: "bad-anchor-rel-2" - link: unexisting-file.md - anchor: bad-anchor @@ -59,7 +59,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:35:1-29: + bad reference (absolute) at src:39:1-29: - text: "file-abs-1" - link: /dir1/./d1f1.md - anchor: - @@ -69,7 +69,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:36:1-21: + bad reference (absolute) at src:40:1-21: - text: "folder-abs-1" - link: /dir1 - anchor: - @@ -79,7 +79,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:37:1-30: + bad reference (absolute) at src:41:1-30: - text: "folder-abs-2" - link: /dir1/dir2/../ - anchor: - @@ -89,7 +89,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:38:1-58: + bad reference (absolute) at src:42:1-58: - text: "anchor-abs-1" - link: /dir1/../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -99,7 +99,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (absolute) at src:39:1-73: + bad reference (absolute) at src:43:1-73: - text: "anchor-abs-2" - link: /dir1/dir2/../../dir1/./dir2/d2f2.md - anchor: existing-anchor-d2f2 @@ -109,7 +109,17 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:49:1-42: + bad reference (absolute) at src:48:1-37: + - text: "file-abs-slash" + - link: /./dir2/../d1f1.md/ + - anchor: - + + ⛀ File does not exist: + dir1/./dir2/../d1f1.md/ + + + ➥ In file dir1/dir2/d2f1.md + bad reference (relative) at src:54:1-42: - text: "path-through-top-dir" - link: ../../dir1/d1f1.md - anchor: - @@ -119,7 +129,7 @@ ➥ In file dir1/dir2/d2f1.md - bad reference (relative) at src:50:1-75: + bad reference (relative) at src:55:1-75: - text: "path-through-top-dir-with-anchor" - link: ../../dir1/d1f1.md - anchor: existing-anchor-d1f1 @@ -128,4 +138,4 @@ dir1/dir2/../../dir1/d1f1.md -Invalid references dumped, 13 in total. +Invalid references dumped, 14 in total.