Skip to content

Commit

Permalink
fix: demo and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Oct 5, 2024
1 parent dc6d099 commit ce2dc70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions example/demo.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

declare ROOT_DIR
ROOT_DIR="$(dirname "${BASH_SOURCE[0]}")"
# shellcheck disable=SC2155
declare ROOT_DIR="$(dirname "${BASH_SOURCE[0]}")"

source "$ROOT_DIR/../src/debug.sh"
source "$ROOT_DIR/../src/dumper.sh"

dump "hello, there"

Expand Down
7 changes: 4 additions & 3 deletions tests/dumper_test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

function set_up() {
source "./src/debug.sh"
ROOT_DIR="$(dirname "${BASH_SOURCE[0]}")"
source "$ROOT_DIR/../src/dumper.sh"
}

function test_dump() {
assert_equals \
"[DUMP] tests/debug_test.sh:10: hello, there"\
"[DUMP] tests/dumper_test.sh:11: hello, there"\
"$(dump "hello, there")"
}

Expand All @@ -15,6 +16,6 @@ function test_debug_var() {
local foo="a value"

assert_equals \
"[DEBUG] tests/debug_test.sh:19: foo=a value"\
"[DEBUG] tests/dumper_test.sh:20: foo=a value"\
"$(debug_var foo)"
}

0 comments on commit ce2dc70

Please sign in to comment.