2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test basic add and list of __abbr1
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr __abbr1 alpha beta gamma
|
|
|
|
abbr | grep __abbr1
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Erasing one that doesn\'t exist should do nothing
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr --erase NOT_AN_ABBR
|
|
|
|
abbr | grep __abbr1
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Adding existing __abbr1 should be idempotent
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr __abbr1 alpha beta gamma
|
|
|
|
abbr | grep __abbr1
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Replacing __abbr1 definition
|
2017-07-03 20:05:50 +00:00
|
|
|
abbr __abbr1 delta
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr | grep __abbr1
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg __abbr1 -s and --show tests
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr -s | grep __abbr1
|
|
|
|
abbr --show | grep __abbr1
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test erasing __abbr1
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr -e __abbr1
|
|
|
|
abbr | grep __abbr1
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Ensure we escape special characters on output
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr '~__abbr2' '$xyz'
|
|
|
|
abbr | grep __abbr2
|
|
|
|
abbr -e '~__abbr2'
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Ensure we handle leading dashes in abbreviation names properly
|
2015-06-14 21:13:57 +00:00
|
|
|
abbr -- '--__abbr3' 'xyz'
|
|
|
|
abbr | grep __abbr3
|
2016-05-23 18:19:22 +00:00
|
|
|
abbr -e -- '--__abbr3'
|
2016-01-07 20:32:16 +00:00
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test that an abbr word containing spaces is rejected
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr "a b c" "d e f"
|
|
|
|
abbr | grep 'a b c'
|
2016-05-19 14:48:45 +00:00
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test renaming
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr __abbr4 omega
|
|
|
|
abbr | grep __abbr5
|
|
|
|
abbr -r __abbr4 __abbr5
|
|
|
|
abbr | grep __abbr5
|
|
|
|
abbr -e __abbr5
|
|
|
|
abbr | grep __abbr4
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test renaming a nonexistent abbreviation
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr -r __abbr6 __abbr
|
2016-12-01 21:19:48 +00:00
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test renaming to a abbreviation with spaces
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr __abbr4 omega
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr -r __abbr4 "g h i"
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr -e __abbr4
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test renaming without arguments
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr __abbr7 omega
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr -r __abbr7
|
2016-12-01 21:19:48 +00:00
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test renaming with too many arguments
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr __abbr8 omega
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr -r __abbr8 __abbr9 __abbr10
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr | grep __abbr8
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr | grep __abbr9
|
|
|
|
abbr | grep __abbr10
|
2016-12-01 21:19:48 +00:00
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
logmsg Test renaming to existing abbreviation
|
2016-12-01 21:19:48 +00:00
|
|
|
abbr __abbr11 omega11
|
|
|
|
abbr __abbr12 omega12
|
2017-05-22 05:22:55 +00:00
|
|
|
abbr -r __abbr11 __abbr12
|
|
|
|
|
2017-08-03 22:02:57 +00:00
|
|
|
exit 0 # the last `abbr` command is expected to fail -- don't let that cause a test failure
|