/
cat.sh
executable file
·39 lines (30 loc) · 1007 Bytes
/
cat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -eu -o pipefail
exe=(cargo run --example stupicat --)
root="$(cd "${0%/*}" && pwd)"
# shellcheck source=./tests/utilities.sh
source "$root/utilities.sh"
SUCCESSFULLY=0
title ""
fixture="$root/fixtures"
snapshot="$fixture/snapshots"
(with "a table"
it "succeeds" && \
WITH_SNAPSHOT="$snapshot/stupicat-table-output" \
expect_run_sh $SUCCESSFULLY "${exe[*]} $fixture/table.md 2>/dev/null"
)
(with "a more complex ordered list"
it "succeeds" && \
WITH_SNAPSHOT="$snapshot/stupicat-ordered-output" \
expect_run_sh $SUCCESSFULLY "${exe[*]} $fixture/ordered.md 2>/dev/null"
)
(with "a more complex unordered list"
it "succeeds" && \
WITH_SNAPSHOT="$snapshot/stupicat-unordered-output" \
expect_run_sh $SUCCESSFULLY "${exe[*]} $fixture/unordered.md 2>/dev/null"
)
(with "a standard common-mark example file"
it "succeeds" && \
WITH_SNAPSHOT="$snapshot/stupicat-output" \
expect_run_sh $SUCCESSFULLY "${exe[*]} $fixture/common-mark.md 2>/dev/null"
)