]> git.cworth.org Git - notmuch/blobdiff - test/test-lib.sh
test: define and use notmuch_sexp_*_sanitize functions
[notmuch] / test / test-lib.sh
index 75a62214db5eb176fc7f96ca11b3ca80a1c2aa7d..4eb58ea0a29a4e8c08ec6869b479d5e07588967a 100644 (file)
@@ -527,6 +527,20 @@ notmuch_json_show_sanitize () {
        -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
 }
 
+notmuch_sexp_show_sanitize () {
+    sed \
+       -e 's|:id "[^"]*"|:id "XXXXX"|g' \
+       -e 's|:Date "Sat, 01 Jan 2000 [^"]*0000"|:Date "GENERATED_DATE"|g' \
+       -e 's|:filename "signature.asc"||g' \
+       -e 's|:filename ("/[^"]*")|:filename ("YYYYY")|g' \
+       -e 's|:timestamp 9........|:timestamp 42|g' \
+       -e 's|:content-length [1-9][0-9]*|:content-length "NONZERO"|g'
+}
+
+notmuch_sexp_search_sanitize () {
+    sed -e 's|:thread "[^"]*"|:thread "XXX"|'
+}
+
 notmuch_emacs_error_sanitize () {
     local command
     command=$1