]> git.draconx.ca Git - upkg.git/blobdiff - tests/libupkg-index-decode.sh
tests: Fix libupkg-index-decode test failure on dash.
[upkg.git] / tests / libupkg-index-decode.sh
index b82bbc94e75f81d9674a7c562b444697c06f4d85..80b328df7d36d188dd098472ee0281d52293cc6f 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # Check various corner cases of upkg_decode_index.
-# Copyright © 2012 Nick Bowler
+# Copyright © 2012, 2022 Nick Bowler
 #
 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
 # This is free software: you are free to do what the fuck you want to.
@@ -15,7 +15,7 @@ test_index() {
                { $decodeindex "$1" 3>&-
                        echo decode_status=$? >&3
                } | { read val 3>&-
-                       echo decode_val=$val >&3
+                       echo decode_val=\'$val\' >&3;
                }`
        eval "$decode_cmd"
 
@@ -38,17 +38,17 @@ test_index() {
        esac
 }
 
-test_index 00 0
-test_index 4000 0
-test_index 408000 0
-test_index 40808000 0
-test_index 4080808000 0
+test_index 00 0         || exit 1
+test_index 4000 0       || exit 1
+test_index 408000 0     || exit 1
+test_index 40808000 0   || exit 1
+test_index 4080808000 0 || exit 1
 
 # False positives
-test_index ''
-test_index 40
-test_index 4080
-test_index 408080
-test_index 40808080
-test_index 4080808080
-test_index 408080808000
+test_index ''           || exit 1
+test_index 40           || exit 1
+test_index 4080         || exit 1
+test_index 408080       || exit 1
+test_index 40808080     || exit 1
+test_index 4080808080   || exit 1
+test_index 408080808000 || exit 1