mirror of
https://github.com/zplug/zplug
synced 2026-03-07 06:31:48 +01:00
Remove double quotes from git_version() array expansion that caused version string matching to fail on zsh 5.9 (scalar join before glob match). Add command-level test suite (add, check, list, clean) with shared test helper for isolated ZPLUG_HOME setup.
36 lines
783 B
Bash
36 lines
783 B
Bash
#!/usr/bin/env zsh
|
|
|
|
source "$ZPLUG_ROOT/test/helper.zsh"
|
|
|
|
T_SUB "list shows error when no plugins registered" ((
|
|
zplugs=()
|
|
|
|
zplug list 2>/dev/null
|
|
t_isnt $status 0 "returns non-zero when zplugs is empty"
|
|
))
|
|
|
|
T_SUB "list succeeds when plugins are registered" ((
|
|
zplugs=()
|
|
zplug "user/plugin-a"
|
|
zplug "user/plugin-b"
|
|
|
|
local output
|
|
output="$(zplug list 2>/dev/null)"
|
|
t_is $status 0 "returns 0 when plugins exist"
|
|
))
|
|
|
|
T_SUB "list output contains registered plugin names" ((
|
|
zplugs=()
|
|
zplug "user/plugin-a"
|
|
zplug "user/plugin-b"
|
|
|
|
local output
|
|
output="$(zplug list 2>&1)"
|
|
|
|
[[ "$output" == *user/plugin-a* ]]
|
|
t_ok $? "output contains plugin-a"
|
|
|
|
[[ "$output" == *user/plugin-b* ]]
|
|
t_ok $? "output contains plugin-b"
|
|
))
|