Blame tests/field_hexnumber_jsoncnf.sh
|
Packit |
1422b7 |
# added 2015-07-22 by Rainer Gerhards
|
|
Packit |
1422b7 |
# This file is part of the liblognorm project, released under ASL 2.0
|
|
Packit |
1422b7 |
. $srcdir/exec.sh
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
test_def $0 "hexnumber field"
|
|
Packit |
1422b7 |
add_rule 'version=2'
|
|
Packit |
1422b7 |
add_rule 'rule=:here is a number %{"name":"num", "type":"hexnumber"}% in hex form'
|
|
Packit |
1422b7 |
execute 'here is a number 0x1234 in hex form'
|
|
Packit |
1422b7 |
assert_output_json_eq '{"num": "0x1234"}'
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
#check cases where parsing failure must occur
|
|
Packit |
1422b7 |
execute 'here is a number 0x1234in hex form'
|
|
Packit |
1422b7 |
assert_output_json_eq '{ "originalmsg": "here is a number 0x1234in hex form", "unparsed-data": "0x1234in hex form" }'
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
cleanup_tmp_files
|