OSDN Git Service

Fix dd tests so TEST_HOST passes. (Ubuntu's dd doesn't support hex values
authorRob Landley <rob@landley.net>
Fri, 7 Jul 2017 08:43:24 +0000 (03:43 -0500)
committerRob Landley <rob@landley.net>
Fri, 7 Jul 2017 08:43:24 +0000 (03:43 -0500)
and don't expect a specific error message, just that it errored.)

tests/dd.test

index 9da2108..1ab06d4 100755 (executable)
@@ -13,8 +13,9 @@ opt="2>/dev/null"
 # Test suffixed number parsing; `count` is representative.
 testing "count=2" "dd if=input count=2 ibs=1 $opt" "hi" "high\n" ""
 testing "count= 2" "dd if=input 'count= 2' ibs=1 $opt" "hi" "high\n" ""
-testing "count=0x2" "dd if=input 'count=0x2' ibs=1 $opt" "hi" "high\n" ""
-testing "count=-2" "dd if=input 'count=-2' ibs=1 2>&1" "dd: invalid number '-2'\n" "" ""
+SKIP_HOST=1 testing "count=0x2" "dd if=input 'count=0x2' ibs=1 $opt" "hi" \
+  "high\n" ""
+testing "count=-2" "dd if=input 'count=-2' ibs=1 2>/dev/null || echo errored" "errored\n" "" ""
 
 testing "if=(file)" "dd if=input $opt" "I WANT\n" "I WANT\n" ""
 testing "of=(file)" "dd of=file $opt && cat file" "I WANT\n" "" "I WANT\n"