From 995fa4056aed2fc0784208f67657fda6884df7da Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 23 Sep 2021 08:59:48 +0200 Subject: [PATCH] regress: Add tests for MetaAttachment --- regress/tests/metadata-test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/regress/tests/metadata-test b/regress/tests/metadata-test index d36ca30e8..c2e816792 100755 --- a/regress/tests/metadata-test +++ b/regress/tests/metadata-test @@ -80,6 +80,10 @@ setdebug level=50 tags=sql trace=1 dir .jlist metadata type=email client=$HOST-fd @$out $tmp/log17.out .jlist metadata type=email tags=important +@$out $tmp/log18.out +.jlist metadata type=attachment name=CV +@$out $tmp/log19.out +.jlist metadata type=attachment name=CV id=AAMkAGZmZjBlMjI0LTMxMmEtNDFkMi1hM2Yx setdebug level=0 tags= dir quit END_OF_DATA @@ -237,4 +241,26 @@ if [ $? != 1 ]; then estat=1 fi +# Should find 2 attachments +grep '{' $tmp/log18.out | perl -MJSON -e ' +$l = <>; +$j = JSON::decode_json($l) ; +exit (scalar(@$j) == 2);' + +if [ $? != 1 ]; then + print_debug "ERROR: Incorrect data in $tmp/log18.out" + estat=1 +fi + +# Should find 2 attachments +grep '{' $tmp/log19.out | perl -MJSON -e ' +$l = <>; +$j = JSON::decode_json($l) ; +exit (scalar(@$j) == 2);' + +if [ $? != 1 ]; then + print_debug "ERROR: Incorrect data in $tmp/log19.out" + estat=1 +fi + end_test -- 2.47.3