[tor-commits] [chutney/master] fixup! fixup! test: Add tests/unit-tests.sh

teor at torproject.org teor at torproject.org
Fri Apr 12 02:43:09 UTC 2019


commit 65c669cc4dd5b53463553fd32a35ed533dad948e
Author: teor <teor at torproject.org>
Date:   Mon Apr 8 11:50:41 2019 +1000

    fixup! fixup! test: Add tests/unit-tests.sh
---
 tests/unit-tests.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/unit-tests.sh b/tests/unit-tests.sh
index 5abc7a9..07e8b32 100755
--- a/tests/unit-tests.sh
+++ b/tests/unit-tests.sh
@@ -26,7 +26,7 @@ test -n "$LOG_FILE"
 unset CHUTNEY_DEBUG
 export CHUTNEY_DEBUG
 lib/chutney/Debug.py | tee "$LOG_FILE"
-LOG_FILE_LINES=$(wc -l "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
+LOG_FILE_LINES=$(wc -l < "$LOG_FILE")
 test "$LOG_FILE_LINES" -eq 1
 
 LOG_FILE=$(mktemp)
@@ -35,7 +35,7 @@ test -n "$LOG_FILE"
 
 export CHUTNEY_DEBUG=1
 lib/chutney/Debug.py | tee "$LOG_FILE"
-LOG_FILE_LINES=$(wc -l "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
+LOG_FILE_LINES=$(wc -l < "$LOG_FILE")
 test "$LOG_FILE_LINES" -eq 2
 
 unset CHUTNEY_DEBUG
@@ -68,9 +68,9 @@ PYTHONPATH=$PYTHONPATH:lib lib/chutney/Traffic.py 9999 | tee "$LOG_FILE"
 
 # Traffic.py produces output with a single newline. But we don't want to get
 # too picky about the details: allow an extra line and a few extra chars.
-LOG_FILE_LINES=$(wc -l "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
+LOG_FILE_LINES=$(wc -l < "$LOG_FILE")
 test "$LOG_FILE_LINES" -le 2
-LOG_FILE_CHARS=$(wc -c "$LOG_FILE" | sed -e "s/[^0-9]*\([0-9]*\).*/\1/")
+LOG_FILE_CHARS=$(wc -c < "$LOG_FILE")
 test "$LOG_FILE_CHARS" -le 4
 
 





More information about the tor-commits mailing list