Skip to content

Commit b18add3

Browse files
Add some test cases.
1 parent 23daf8c commit b18add3

16 files changed

Lines changed: 242 additions & 16 deletions

File tree

.github/workflows/check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ jobs:
1515
build:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
19+
- name: Add tools
20+
run: sudo apt-get update -y && sudo apt-get install -y graphviz
1921
- name: Format
2022
run: cargo fmt --check
2123
- name: Build
2224
run: cargo build
25+
- name: Test
26+
run: cargo test
2327
- name: Clippy
2428
run: cargo clippy --all-targets --all-features
2529
- name: Build with 1.74

Cargo.lock

Lines changed: 55 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ serde = {version = "1", features = ["derive"]}
2121
thiserror = "1"
2222
toml = "0.7"
2323

24+
[dev-dependencies]
25+
folder_compare = "0.4.0"
26+
2427
# The profile that 'cargo dist' will build with
2528
[profile.dist]
2629
inherits = "release"

tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data_out

tests/data_in/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
book

tests/data_in/book.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[book]
2+
authors = ["Jonathan Pallant"]
3+
language = "en"
4+
multilingual = false
5+
src = "src"
6+
title = "Sample Book"

tests/data_in/index_template.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>$TITLE</title>
5+
</head>
6+
<body class="article">
7+
<h1>$TITLE</h1>
8+
<div>
9+
$INDEX
10+
</div>
11+
</body>
12+
</html>

tests/data_in/src/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Summary
2+
3+
- [Chapter 1](./chapter_1.md)
4+
- [Chapter 2](./chapter_2.md)

tests/data_in/src/chapter_1.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Page 1
2+
3+
## Page 2
4+
5+
---
6+
7+
Page 3
8+
9+
## Page 4

tests/data_in/src/chapter_2.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Page 1
2+
3+
```dot process
4+
digraph {
5+
node [shape=record];
6+
"X";
7+
}
8+
```
9+
10+
## Page 2

0 commit comments

Comments
 (0)