diff options
author | Ron Yorston <rmy@pobox.com> | 2018-02-09 09:52:52 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-09 20:35:48 +0200 |
commit | 1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7 (patch) | |
tree | a41b553f1cd5506d94a1c60951cdafbe9f6f6917 /testsuite | |
parent | 9db344a0f4ed5f6f893940b734215d05e48320e9 (diff) | |
download | busybox-w32-1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7.tar.gz busybox-w32-1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7.tar.bz2 busybox-w32-1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7.zip |
testsuite: allow tests to work in paths containing spaces
Tweak some tests so they work when the path to the test directory or
$HOME contains spaces.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/grep.tests | 2 | ||||
-rwxr-xr-x | testsuite/printf.tests | 2 | ||||
-rw-r--r-- | testsuite/pwd/pwd-prints-working-directory | 2 | ||||
-rwxr-xr-x | testsuite/sum.tests | 6 | ||||
-rw-r--r-- | testsuite/xargs/xargs-works | 6 |
5 files changed, 10 insertions, 8 deletions
diff --git a/testsuite/grep.tests b/testsuite/grep.tests index d0b0d2767..e57889790 100755 --- a/testsuite/grep.tests +++ b/testsuite/grep.tests | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | testing "grep (exit with error)" "grep nonexistent 2> /dev/null ; echo \$?" \ | 16 | testing "grep (exit with error)" "grep nonexistent 2> /dev/null ; echo \$?" \ |
17 | "1\n" "" "" | 17 | "1\n" "" "" |
18 | testing "grep (exit success)" "grep grep $0 > /dev/null 2>&1 ; echo \$?" "0\n" \ | 18 | testing "grep (exit success)" "grep grep '$0' > /dev/null 2>&1 ; echo \$?" "0\n" \ |
19 | "" "" | 19 | "" "" |
20 | # Test various data sources and destinations | 20 | # Test various data sources and destinations |
21 | 21 | ||
diff --git a/testsuite/printf.tests b/testsuite/printf.tests index 9a3c87473..963ded94b 100755 --- a/testsuite/printf.tests +++ b/testsuite/printf.tests | |||
@@ -20,7 +20,7 @@ testing "printf produces no further output 2" \ | |||
20 | "" "" | 20 | "" "" |
21 | 21 | ||
22 | testing "printf repeatedly uses pattern for each argv" \ | 22 | testing "printf repeatedly uses pattern for each argv" \ |
23 | "${bb}printf '%s\n' foo \$HOME" \ | 23 | "${bb}printf '%s\n' foo '$HOME'" \ |
24 | "foo\n$HOME\n" \ | 24 | "foo\n$HOME\n" \ |
25 | "" "" | 25 | "" "" |
26 | 26 | ||
diff --git a/testsuite/pwd/pwd-prints-working-directory b/testsuite/pwd/pwd-prints-working-directory index 971adb5a6..fc7fea7c9 100644 --- a/testsuite/pwd/pwd-prints-working-directory +++ b/testsuite/pwd/pwd-prints-working-directory | |||
@@ -1,4 +1,4 @@ | |||
1 | # shell's $PWD may leave symlinks unresolved. | 1 | # shell's $PWD may leave symlinks unresolved. |
2 | # "pwd" may be a built-in and have the same problem. | 2 | # "pwd" may be a built-in and have the same problem. |
3 | # External pwd _can't_ have that problem (current dir on Unix is physical). | 3 | # External pwd _can't_ have that problem (current dir on Unix is physical). |
4 | test $(`which pwd`) = $(busybox pwd) | 4 | test "$(`which pwd`)" = "$(busybox pwd)" |
diff --git a/testsuite/sum.tests b/testsuite/sum.tests index b9f4cbfa8..e6379349f 100755 --- a/testsuite/sum.tests +++ b/testsuite/sum.tests | |||
@@ -13,12 +13,12 @@ | |||
13 | # test can create a file "actual" instead of writing to stdout | 13 | # test can create a file "actual" instead of writing to stdout |
14 | 14 | ||
15 | testing "sum -r file doesn't print file's name" \ | 15 | testing "sum -r file doesn't print file's name" \ |
16 | "sum -r $0 | grep -c $0 && echo wrongly_printed_filename || echo yes" \ | 16 | "sum -r '$0' | grep -c '$0' && echo wrongly_printed_filename || echo yes" \ |
17 | "0\nyes\n" "" "" | 17 | "0\nyes\n" "" "" |
18 | testing "sum -r file file does print both names" \ | 18 | testing "sum -r file file does print both names" \ |
19 | "sum -r $0 $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \ | 19 | "sum -r '$0' '$0' | grep -c '$0' && echo yes || echo wrongly_omitted_filename" \ |
20 | "2\nyes\n" "" "" | 20 | "2\nyes\n" "" "" |
21 | testing "sum -s file does print file's name" \ | 21 | testing "sum -s file does print file's name" \ |
22 | "sum -s $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \ | 22 | "sum -s '$0' | grep -c '$0' && echo yes || echo wrongly_omitted_filename" \ |
23 | "1\nyes\n" "" "" | 23 | "1\nyes\n" "" "" |
24 | exit $FAILCOUNT | 24 | exit $FAILCOUNT |
diff --git a/testsuite/xargs/xargs-works b/testsuite/xargs/xargs-works index c95869e89..a4bba7630 100644 --- a/testsuite/xargs/xargs-works +++ b/testsuite/xargs/xargs-works | |||
@@ -1,4 +1,6 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM | ||
2 | |||
1 | [ -n "$d" ] || d=.. | 3 | [ -n "$d" ] || d=.. |
2 | find "$d" -name \*works -type f | xargs md5sum > logfile.gnu | 4 | find "$d" -name \*works -type f -print0 | xargs -0 md5sum > logfile.gnu |
3 | find "$d" -name \*works -type f | busybox xargs md5sum > logfile.bb | 5 | find "$d" -name \*works -type f -print0 | busybox xargs -0 md5sum > logfile.bb |
4 | diff -u logfile.gnu logfile.bb | 6 | diff -u logfile.gnu logfile.bb |