diff --git a/README.adoc b/README.adoc index 84f847e..61d23db 100644 --- a/README.adoc +++ b/README.adoc @@ -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 diff --git a/tests/test_doc.sh b/tests/test_doc.sh index 47d086b..f5ce0ca 100644 --- a/tests/test_doc.sh +++ b/tests/test_doc.sh @@ -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