Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -671,19 +671,26 @@ This can be useful when one has tests that are dependent on system environment,
skip_if "uname | grep Darwin" linux
skip_if "uname | grep Linux" darwin

test_linux_proc_exists() {
test_1_linux_proc_exists() {
assert "ls /proc/" "there should exist /proc on Linux"
}
test_darwin_proc_does_not_exist() {
test_2_darwin_proc_does_not_exist() {
assert_fail "ls /proc/" "there should not exist /proc on Darwin"
}
```

will output, on a Linux system:
will output on Linux:

```output
Running test_darwin_proc_does_not_exist ... SKIPPED
Running test_linux_proc_exists ... SUCCESS
```output-linux
Running test_1_linux_proc_exists ... SUCCESS
Running test_2_darwin_proc_does_not_exist ... SKIPPED
```

and on Darwin:

```output-darwin
Running test_1_linux_proc_exists ... SKIPPED
Running test_2_darwin_proc_does_not_exist ... SUCCESS
```

== *fake* function
Expand Down
6 changes: 5 additions & 1 deletion tests/test_doc.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env bash

TEST_PATTERN='```test'
OUTPUT_PATTERN='```output'
if [[ "$(uname)" == "Darwin" ]]; then
OUTPUT_PATTERN='```output(-darwin)?'
else
OUTPUT_PATTERN='```output(-linux)?'
fi
LANG=C.UTF-8
unset LC_ALL LANGUAGE

Expand Down
Loading