Port alias test to littlecheck

This commit is contained in:
Fabian Homborg
2019-06-26 21:02:14 +02:00
parent 9462aacc5c
commit 8e11f802b4
4 changed files with 18 additions and 29 deletions

18
tests/checks/alias.fish Normal file
View File

@@ -0,0 +1,18 @@
#RUN: %fish %s
# Avoid regressions of issue \#3860 wherein the first word of the alias ends with a semicolon
function foo
echo ran foo
end
alias my_alias "foo; and echo foo ran"
my_alias
# CHECK: ran foo
# CHECK: foo ran
alias a-2='echo "hello there"'
# Bare `alias` should list the aliases we have created and nothing else
# We have to exclude two aliases because they're an artifact of the unit test
# framework and we can't predict the definition.
alias | grep -Ev '^alias (fish_indent|fish_key_reader) '
# CHECK: alias a-2 'echo "hello there"'
# CHECK: alias my_alias 'foo; and echo foo ran'