1
0
Fork 0
mirror of https://github.com/zdharma-continuum/zinit.git synced 2025-01-31 00:58:17 +01:00
zinit/tests/compile.zunit
vladislav doster b7b8347cad
fix: compile command logic when using id-as ice (#619)
- Updated README.md `compiling` section
- Compile commands now work with `id-as` ice
- Compile command options added to tab completion  

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2024-03-03 23:43:48 -06:00

53 lines
2.2 KiB
Bash

#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
@setup {
typeset -gx HOME="$zi_test_dir"
typeset -gx ZBIN="$zi_test_dir/polaris/bin"
}
@test 'compile ice - multiple files' {
run zinit for compile'h*~*zwc' id-as'hsmw-compile-ice' @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile hsmw-compile-ice)
assert $output contains "==> Compiling 4 files history-search-multi-word, history-search-multi-word.plugin.zsh, hsmw-context-main, hsmw-highlight [OK]"
assert $state equals 0
}
@test 'compile ice - single file' {
run zinit for id-as'hsmw-no-compile-ice' @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile hsmw-no-compile-ice)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
}
@test 'compile ice' {
run zinit light @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile zdharma-continuum/history-search-multi-word)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
}
@test 'compile cmd' {
run zinit for id-as"compile-command" @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile --quiet compile-command)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compiled)
assert $state equals 0
assert $output contains 'compile-command:'
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit uncompile --quiet compile-command)
assert $state equals 0; assert $output contains '==> Uncompiling compile-command [OK]'
}
@test 'compiled cmd' {
zinit uncompile --all --quiet
run zinit compiled; assert $state equals 0
assert $output contains 'No compiled plugins'
}
@test 'uncompile cmd' {
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile -q compile-command)
assert $state equals 0
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit uncompile -q compile-command)
assert $state equals 0
assert $output contains '==> Uncompiling compile-command [OK]'
}