Skip to content

Commit d6dc9fc

Browse files
authored
Merge pull request #108 from mbland/minor-updates
Fix `@go.array_printf` comment, add tests for missing coverage
2 parents d15a052 + 674636d commit d6dc9fc

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

lib/format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# provides a portable means of printing to an array variable while avoiding the
2424
# use of `eval`.
2525
#
26-
# NOTE: By default, this function relies on the ASCII Record Separator character
26+
# NOTE: By default, this function relies on the ASCII Unit Separator character
2727
# ($'\x1f') to delimit generated strings before splitting them into the result
2828
# array. If you have strings containing this character, you can set a new
2929
# delimiter via `_GO_ARRAY_PRINTF_DELIMITER`.

tests/core/set-scripts-dir.bats

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ teardown() {
3535
assert_failure "$expected"
3636
}
3737

38+
@test "$SUITE: produce an error if the script dir isn't a directory" {
39+
rm -rf "$TEST_GO_SCRIPTS_DIR"
40+
printf '' >"$TEST_GO_SCRIPTS_DIR"
41+
run "$TEST_GO_SCRIPT"
42+
assert_failure "ERROR: $TEST_GO_SCRIPTS_DIR is not a directory"
43+
}
44+
3845
@test "$SUITE: produce an error if the script dir can't be read or accessed" {
3946
skip_if_cannot_trigger_file_permission_failure
4047

tests/testing/stubbing.bats

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ teardown() {
2626
[ -e "$_GO_CORE_DIR/lib/log" ]
2727
assert_success 'Hello, World!'
2828
}
29+
30+
31+
@test "$SUITE: create_core_module_stub aborts if module unknown" {
32+
[ ! -e "$_GO_CORE_DIR/lib/foobar" ]
33+
run create_core_module_stub 'foobar' 'echo Hello, World!'
34+
assert_failure "No such core module: $_GO_CORE_DIR/lib/foobar"
35+
}

0 commit comments

Comments
 (0)