From 34ed958f72c3d36967cb2a79bad56e60562132c0 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 17 Jan 2019 16:43:24 +0100 Subject: [PATCH] Test that things can't wrap themselves This is a test belonging to the previous commit, 58b696bed. See #5541. --- tests/complete.in | 8 +++++++- tests/complete.out | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/complete.in b/tests/complete.in index 857cc9deb..647e4b3f1 100644 --- a/tests/complete.in +++ b/tests/complete.in @@ -18,4 +18,10 @@ alias myalias2='complete_test_alpha1 arg2' myalias1 call1 myalias2 call2 complete -C'myalias1 call3 ' -complete -C'myalias2 call3 ' \ No newline at end of file +complete -C'myalias2 call3 ' + +# Ensure that commands can't wrap themselves - if this did, +# the completion would be executed a bunch of times. +function t --wraps t; echo t; end +complete -c t -fa '(t)' +complete -C't ' diff --git a/tests/complete.out b/tests/complete.out index 419d0d3ac..d813b436e 100644 --- a/tests/complete.out +++ b/tests/complete.out @@ -11,3 +11,4 @@ arg1 call1 arg2 call2 complete_test_alpha1 arg1 call3 complete_test_alpha1 arg2 call3 +t