Port: don't quote wc output in test scripts
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 30 Aug 2017 18:29:26 +0000 (14:29 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 31 Aug 2017 20:44:21 +0000 (16:44 -0400)
The 'wc' command on macOS prefixes the count it returns with spaces, if
we quote the output it won't be properly converted to integer for the
comparison.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/cli/intersection/test_intersection.in

index 07a267fe85c796faa3767c0a4bdec48abd3dd43f..7cea9be7eb12b29f31ddfca671ba22aa1b526498 100644 (file)
@@ -26,9 +26,9 @@ test_intersect() {
        totalevents="$2"
        intersect="$3"
 
-       test "$("${BT_BIN}" "$trace" | wc -l)" = "$totalevents"
+       test $("${BT_BIN}" "$trace" | wc -l) = "$totalevents"
        ok $? "$totalevents events in the whole trace"
-       test "$("${BT_BIN}" --stream-intersection "$trace" 2>/dev/null| wc -l)" = "$intersect"
+       test $("${BT_BIN}" --stream-intersection "$trace" 2>/dev/null| wc -l) = "$intersect"
        ok $? "$intersect events in packets intersecting"
 }
 
This page took 0.024869 seconds and 4 git commands to generate.