Skip to content

Commit

Permalink
Added inline html and html document to fragment checks test
Browse files Browse the repository at this point in the history
  • Loading branch information
HU90m committed Aug 4, 2023
1 parent 53302dc commit cfe9c18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions fixtures/fragments/file1.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ This is a test file for the fragment loader.
Explicit fragment links are currently not supported.
Therefore we put the test into a code block for now to prevent false positives.

```
<a name="explicit-fragment"></a>
<a id="explicit-fragment"></a>

[Link to explicit fragment](#explicit-fragment)
```

[To the html doc](file.html#a-word)

## Custom Fragments

Expand Down
12 changes: 8 additions & 4 deletions lychee-bin/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1410,19 +1410,23 @@ mod cli {
.arg(input)
.assert()
.failure()
.stderr(contains("fixtures/fragments/file1.md#fragment-1"))
.stderr(contains("fixtures/fragments/file1.md#fragment-2"))
.stderr(contains("fixtures/fragments/file2.md#custom-id"))
.stderr(contains("fixtures/fragments/file1.md#missing-fragment"))
.stderr(contains("fixtures/fragments/file2.md#fragment-1"))
.stderr(contains("fixtures/fragments/file1.md#kebab-case-fragment"))
.stderr(contains("fixtures/fragments/file2.md#missing-fragment"))
.stderr(contains("fixtures/fragments/empty_file#fragment"))
.stderr(contains("fixtures/fragments/file.html#a-word"))
.stderr(contains("fixtures/fragments/file.html#in-the-beginning"))
.stderr(contains("fixtures/fragments/file.html#in-the-end"))
.stderr(contains(
"fixtures/fragments/file1.md#kebab-case-fragment-1",
))
.stdout(contains("8 Total"))
.stdout(contains("6 OK"))
// 2 failures because of missing fragments
.stdout(contains("2 Errors"));
.stdout(contains("13 Total"))
.stdout(contains("10 OK"))
// 3 failures because of missing fragments
.stdout(contains("3 Errors"));
}
}

0 comments on commit cfe9c18

Please sign in to comment.