summaryrefslogtreecommitdiff
path: root/tests/test_substitution.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2011-07-12 15:38:47 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2011-07-12 15:38:47 +0000
commit6ec3c929abd10d8c7e2e99c089b5ecc4eac69375 (patch)
treec19d9c3a1289fbf4a50b9bffc50bddb4912a323f /tests/test_substitution.c
parent3f44b08b7bf589e393e0f373ec4725c4f4bff21b (diff)
Merged revisions 327793 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327793 | tilghman | 2011-07-12 10:35:46 -0500 (Tue, 12 Jul 2011) | 14 lines Use 'printf' (POSIX issue 4) instead of 'echo -n', for portability. The problem with using 'echo -n' is that it is not portable. While BSD systems required that the '-n' option be removed and interpreted, System V required that all strings should be echoed with no interpretation of options. This fundamental difference of behavior means that it is never possible to use the '-n' flag to echo in tests which are meant to be portable. In this case, on Mac OS X 10.6, the /bin/sh shell builtin 'echo' uses the System V semantics of the command, and thus the SHELL test failed on that platform. http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html#tag_04_41_16 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests/test_substitution.c')
-rw-r--r--tests/test_substitution.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_substitution.c b/tests/test_substitution.c
index b335d50ba..cb3161691 100644
--- a/tests/test_substitution.c
+++ b/tests/test_substitution.c
@@ -261,8 +261,8 @@ AST_TEST_DEFINE(test_substitution)
TEST(test_expected_result(test, c, "A${${baz}o:-2:-1}A", "A2A"));
pbx_builtin_setvar_helper(c, "list1", "ab&cd&ef");
TEST(test_expected_result(test, c, "${LISTFILTER(list1,&,cd)}", "ab&ef"));
- TEST(test_expected_result(test, c, "${SHELL(printf 123)},${SHELL(printf 456)}", "123,456"));
- TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(printf 456)}", "123,,456"));
+ TEST(test_expected_result(test, c, "${SHELL(printf '%d' 123)},${SHELL(printf '%d' 456)}", "123,456"));
+ TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(printf '%d' 456)}", "123,,456"));
TEST(test_expected_result(test, c, "${foo},${this_does_not_exist},${THIS_DOES_NOT_EXIST(either)}", "123,,"));
#undef TEST