aboutsummaryrefslogtreecommitdiff
path: root/scripts/test
diff options
context:
space:
mode:
authorElie De Brauwer <eliedebrauwer@gmail.com>2012-02-11 14:58:50 +0100
committerElie De Brauwer <eliedebrauwer@gmail.com>2012-02-11 14:58:50 +0100
commitef3e5284bf078ef3cb0bd21c4883b341f8a2cb96 (patch)
tree41c3caed036bc84035728df8e1fd3ab4943e0217 /scripts/test
parentd2ad17b2e50924233b589fa04fbf0462b9998ed0 (diff)
downloadtoybox-ef3e5284bf078ef3cb0bd21c4883b341f8a2cb96.tar.gz
Fix overflow in octal formatting in echo, add support for hexadecimal input, add tests for octal and hexadecimal formatting
Diffstat (limited to 'scripts/test')
-rwxr-xr-xscripts/test/echo.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/test/echo.test b/scripts/test/echo.test
index 3eac172f..e269bf20 100755
--- a/scripts/test/echo.test
+++ b/scripts/test/echo.test
@@ -23,3 +23,13 @@ testing "echo --hello" "$CMD --hello" "--hello\n" "" ""
testing "echo -e all" "$CMD -e '\a\b\c\f\n\r\t\v\\\0123'" \
"\a\b\c\f\n\r\t\v\\\0123\n" "" ""
testing "echo -nex hello" "$CMD -nex hello" "-nex hello\n" "" ""
+
+# Octal formatting tests
+testing "echo -e octal values" \
+ "$CMD -ne '\01234 \0060 \060 \0130\0131\0132 \077\012'" \
+ "S4 0 0 XYZ ?\n" "" ""
+
+# Hexadecimal value tests
+testing "echo -e hexadecimal values" \
+ "$CMD -ne '\x534 \x30 \x58\x59\x5a \x3F\x0A'"\
+ "S4 0 XYZ ?\n" "" ""