zsh/.zsh/plugins/autopairs/tests/get-pair.zunit
2024-12-11 15:02:36 +01:00

26 lines
635 B
Text

#!/usr/bin/env zunit
@test 'existing pair' {
assert $(_ap-get-pair "{") same_as "}"
}
@test 'existing right-pair' {
assert $(_ap-get-pair "" "}") same_as "{"
}
@test 'non-existent pair' {
assert $(_ap-get-pair "<") same_as ""
}
@test 'non-existent right-pair' {
assert $(_ap-get-pair "" ">") same_as ""
}
@test 'all default pairs' {
assert '"' in ${(@k)AUTOPAIR_PAIRS}
assert "'" in ${(@k)AUTOPAIR_PAIRS}
assert '`' in ${(@k)AUTOPAIR_PAIRS}
assert '{' in ${(@k)AUTOPAIR_PAIRS}
assert '[' in ${(@k)AUTOPAIR_PAIRS}
assert '(' in ${(@k)AUTOPAIR_PAIRS}
assert ' ' in ${(@k)AUTOPAIR_PAIRS}
}