Skip to content

Commit

Permalink
tests: this last case is abysmal.
Browse files Browse the repository at this point in the history
Actually it looks like all the link stuff is just +2, probably because
of the indent-but-not-really-indent.
  • Loading branch information
kivikakk committed Jul 12, 2024
1 parent 9a4262c commit 63b967e
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/tests/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ fn case_insensitive_safety() {
fn link_sourcepos_baseline() {
assert_ast_match!(
[],
"[ABCD](/)",
"[ABCD](/)\n",
(document (1:1-1:9) [
(paragraph (1:1-1:9) [
(link (1:1-1:9) [
Expand All @@ -511,11 +511,12 @@ fn link_sourcepos_baseline() {
);
}

// https://github.com/kivikakk/comrak/issues/301
#[test]
fn link_sourcepos_newline() {
assert_ast_match!(
[],
"[AB\nCD](/)",
"[AB\nCD](/)\n",
(document (1:1-2:6) [
(paragraph (1:1-2:6) [
(link (1:1-2:6) [
Expand All @@ -527,3 +528,26 @@ fn link_sourcepos_newline() {
])
);
}

#[test]
fn link_sourcepos_truffle() {
assert_ast_match!(
[],
"- A\n[![B](/B.png)](/B)\n",
(document (1:1-2:18) [
(list (1:1-2:18) [
(item (1:1-2:18) [
(paragraph (1:3-2:18) [
(text (1:3-1:3) "A")
(softbreak (1:4-1:4))
(link (2:1-2:18) [
(image (2:2-2:13) [
(text (2:4-2:4) "B")
])
])
])
])
])
])
);
}

0 comments on commit 63b967e

Please sign in to comment.