From 55518bfa2b601fbfd3db1a4a93f32dff3424e048 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Wed, 21 Oct 2015 17:53:05 +0200 Subject: [PATCH] Make tests compatible with pg bool output --- geocoder/admin0/test/run.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/geocoder/admin0/test/run.sh b/geocoder/admin0/test/run.sh index 7b87cc3..89c96ef 100644 --- a/geocoder/admin0/test/run.sh +++ b/geocoder/admin0/test/run.sh @@ -98,9 +98,16 @@ function sql() { if [[ "$2" == "should" ]] then if [[ "${RESULT}" != "$3" ]] - then - log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'" - set_failed + then + # Deal with bool values from pg, returned as t/f instead of true/false + if [[ "$3" == "true" && "${RESULT}" == "t" ]] || [[ "$3" == "false" && "${RESULT}" == "f" ]] + then + # do nothing, test ok + true + else + log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'" + set_failed + fi fi fi fi