From 7db3a2de13d5248bbd3a9cdda9676548569df428 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Tue, 28 Feb 2012 09:38:57 +0100 Subject: [PATCH] test-lib: Allow completions containing whitespace. This is necessary to test the completion of task text. --- tests/README | 12 +++++++----- tests/test-lib.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/README b/tests/README index aae3b30..d5fc70a 100644 --- a/tests/README +++ b/tests/README @@ -191,11 +191,13 @@ library for your script to use. This takes three strings as parameter. Based on , the todo_completion script is triggered in the current test environment and completions are compared with , - which should be a space-separated list. Include a trailing - space in when you want to check new argument - completion; otherwise, completion is triggered with the - context of the last argument. should state what it - is testing. + which should be a space-separated list. If any completion + contains whitespace, quote it; the entire + argument is eval()'ed. + Include a trailing space in when you want to check + new argument completion; otherwise, completion is triggered + with the context of the last argument. should state + what it is testing. - test_todo_custom_completion diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 7c494d7..b3022dd 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -655,7 +655,7 @@ test_todo_custom_completion () { IFS=' ' set -- $2 COMP_WORDS=("$@") COMP_CWORD=$(($# - $offset)) - IFS=' ' set -- $expected + IFS=' ' eval "set -- $expected" EXPECT=("$@") source "$TEST_DIRECTORY/../todo_completion"