Blame tests/annotate.sh

Packit 1422b7
# added 2016-11-08 by Rainer Gerhards
Packit 1422b7
. $srcdir/exec.sh
Packit 1422b7
Packit 1422b7
test_def $0 "annotate functionality"
Packit 1422b7
Packit 1422b7
reset_rules
Packit 1422b7
add_rule 'version=2'
Packit 1422b7
add_rule 'rule=ABC,WIN:<%-:number%>1 %-:date-rfc5424% %-:word% %tag:word% - - -'
Packit 1422b7
add_rule 'rule=ABC:<%-:number%>1 %-:date-rfc5424% %-:word% %tag:word% + - -'
Packit 1422b7
add_rule 'rule=WIN:<%-:number%>1 %-:date-rfc5424% %-:word% %tag:word% . - -'
Packit 1422b7
add_rule 'annotate=WIN:+annot1="WIN" # inline-comment'
Packit 1422b7
add_rule 'annotate=ABC:+annot2="ABC"'
Packit 1422b7
Packit 1422b7
execute '<37>1 2016-11-03T23:59:59+03:00 server.example.net TAG . - -'
Packit 1422b7
assert_output_json_eq '{ "tag": "TAG", "annot1": "WIN" }'
Packit 1422b7
Packit 1422b7
execute '<37>1 2016-11-03T23:59:59+03:00 server.example.net TAG + - -'
Packit 1422b7
assert_output_json_eq '{ "tag": "TAG", "annot2": "ABC" }'
Packit 1422b7
Packit 1422b7
execute '<6>1 2016-09-02T07:41:07+02:00 server.example.net TAG - - -'
Packit 1422b7
assert_output_json_eq '{ "tag": "TAG", "annot1": "WIN", "annot2": "ABC" }'
Packit 1422b7
Packit 1422b7
cleanup_tmp_files