mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-23 04:25:15 +08:00
Add abbreviation tests
This commit is contained in:
parent
781bbe217a
commit
d79a72d722
1
tests/abbr.err
Normal file
1
tests/abbr.err
Normal file
|
@ -0,0 +1 @@
|
||||||
|
abbr: no such abbreviation 'NOT_AN_ABBR'
|
33
tests/abbr.in
Normal file
33
tests/abbr.in
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# Test basic add and list
|
||||||
|
abbr __abbr1 alpha beta gamma
|
||||||
|
abbr | grep __abbr1
|
||||||
|
|
||||||
|
# Erasing one that doesn't exist should do nothing
|
||||||
|
abbr --erase NOT_AN_ABBR
|
||||||
|
abbr | grep __abbr1
|
||||||
|
|
||||||
|
# Adding existing one should be idempotent
|
||||||
|
abbr __abbr1 alpha beta gamma
|
||||||
|
abbr | grep __abbr1
|
||||||
|
|
||||||
|
# Replacing
|
||||||
|
abbr __abbr1 delta
|
||||||
|
abbr | grep __abbr1
|
||||||
|
|
||||||
|
# -s and --show tests
|
||||||
|
abbr -s | grep __abbr1
|
||||||
|
abbr --show | grep __abbr1
|
||||||
|
|
||||||
|
# Test erasing
|
||||||
|
abbr -e __abbr1
|
||||||
|
abbr | grep __abbr1
|
||||||
|
|
||||||
|
# Ensure we escape special characters on output
|
||||||
|
abbr '~__abbr2' '$xyz'
|
||||||
|
abbr | grep __abbr2
|
||||||
|
abbr -e '~__abbr2'
|
||||||
|
|
||||||
|
# Ensure we handle leading dashes in abbreviation names properly
|
||||||
|
abbr -- '--__abbr3' 'xyz'
|
||||||
|
abbr | grep __abbr3
|
||||||
|
abbr -e '--__abbr3'
|
8
tests/abbr.out
Normal file
8
tests/abbr.out
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
abbr __abbr1 'alpha beta gamma'
|
||||||
|
abbr __abbr1 'alpha beta gamma'
|
||||||
|
abbr __abbr1 'alpha beta gamma'
|
||||||
|
abbr __abbr1 delta
|
||||||
|
abbr __abbr1 delta
|
||||||
|
abbr __abbr1 delta
|
||||||
|
abbr '~__abbr2' '$xyz'
|
||||||
|
abbr -- '--__abbr3' xyz
|
1
tests/abbr.status
Normal file
1
tests/abbr.status
Normal file
|
@ -0,0 +1 @@
|
||||||
|
0
|
Loading…
Reference in New Issue
Block a user