diff options
author | Omar Polo <op@omarpolo.com> | 2024-08-29 17:46:13 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-08-29 17:46:13 +0000 |
commit | 255c15394c1c56ee056d23ccf999bee21a935f7f (patch) | |
tree | 1e9306981af20f9fb9ddaeee7a2b3d97a5693a1e /regress/tests.sh | |
parent | e132ebe389243bd22fc07a1191cb7ceabc6287eb (diff) |
improve failure log of test_log_*
Diffstat (limited to 'regress/tests.sh')
-rw-r--r-- | regress/tests.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/regress/tests.sh b/regress/tests.sh index f4dc0eb..665d1ca 100644 --- a/regress/tests.sh +++ b/regress/tests.sh @@ -506,9 +506,9 @@ log style legacy' # remove the ip awk '{$1 = ""; print substr($0, 2)}' log > log.edited - printf '%s\n' 'GET gemini://localhost/ 20 text/gemini' \ - | cmp -s - log.edited - if [ $? -ne 0 ]; then + printf '%s\n' 'GET gemini://localhost/ 20 text/gemini' > log.exp + if ! cmp -s log.edited log.exp; then + diff -u log.edited log.exp # keep the log for post-mortem analysis return 1 fi @@ -530,8 +530,9 @@ log style common' awk '{$2 = ""; $5 = "timestamp"; print $0}' log > log.edited printf '%s\n' 'localhost - - timestamp +0200 "gemini://localhost/" 20 0' \ - | cmp -s - log.edited - if [ $? -ne 0 ]; then + > log.exp + if ! cmp -s log.edited log.exp; then + diff -u log.edited log.exp # keep the log for post-mortem analysis return 1 fi @@ -552,9 +553,9 @@ log style combined' # remove the ip and timestamp awk '{$1 = ""; print gensub("\\[.*\\]", "[timestamp]", 1)}' log > log.edited - printf '%s\n' ' - - [timestamp] "gemini://localhost/" 20 0 "-" ""' \ - | cmp -s - log.edited - if [ $? -ne 0 ]; then + printf '%s\n' ' - - [timestamp] "gemini://localhost/" 20 0 "-" ""' > log.exp + if ! cmp -s log.edited log.exp; then + diff -u log.edited log.exp # keep the log for post-mortem analysis return 1 fi |