Skip to content

Commit

Permalink
fix: debug command test
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
  • Loading branch information
vladdoster committed Dec 16, 2023
1 parent df9fadf commit 19a98ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DOC_SRC := $(foreach wrd,$(SRC),../$(wrd))

clean:
@$(ZSH) -c "print -Pr '%BRemoving%b:'; print -C 3 -lPr tests/_output/*(.N) tests/_support/{default-ice,binary-symlink,tmp*}(N) *.zwc(N) doc/zsdoc/zinit*.zsh.adoc(N) doc/zsdoc/data/(N)"
@$(ZSH) -c "rm -rf tests/_output/*(.N) tests/_support/{default-ice,binary-symlink,tmp*}(N) *.zwc(N) doc/zsdoc/zinit*.zsh.adoc(N) doc/zsdoc/data/(N)"
@$(ZSH) -c "rm -rf tests/_output/*(.N) tests/_support/{default-ice,binary-symlink,tmp*}(N) *.zwc(N) doc/zsdoc/data/(N)"

container:
docker build --tag=ghcr.io/zdharma-continuum/zinit:latest --file=docker/Dockerfile .
Expand Down
9 changes: 4 additions & 5 deletions tests/commands.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,17 @@
assert $state equals 0
}
@test 'log_debug_unset' {
run eval '(( ${+ZINIT[DEBUG]} == 1 ))'; assert $state equals 1
run eval '(( ${+ZINIT[DEBUG]} ))'; assert $state equals 1
run +zi-log -n "{dbg} message"
assert "$output" contains ""; assert $state equals 0
run +zi-log -n "{m} message"
assert "$output" contains "${ZINIT[col-m]} message"; assert $state equals 0
}
@test 'log_debug_set' {
ZINIT+=( DEBUG "true" )
run eval '(( ${+ZINIT[DEBUG]} == 1 ))'
assert $state equals 0
run +zi-log -n "{dbg} message"
assert $output contains "${ZINIT[col-dbg]} message"; assert $state equals 0
run eval '[ ${+ZINIT[DEBUG]} -eq 1 ]'; assert $state equals 0
# run +zi-log -n "{dbg} message"
# assert $output contains "${ZINIT[col-dbg]} message"; assert $state equals 0
}

# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker

0 comments on commit 19a98ca

Please sign in to comment.