Blame tests/field_float_jsoncnf.sh

Packit 1422b7
# added 2015-02-25 by singh.janmejay
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 "float field"
Packit 1422b7
add_rule 'version=2'
Packit 1422b7
add_rule 'rule=:here is a number %{"name":"num", "type":"float"}% in floating pt form'
Packit 1422b7
execute 'here is a number 15.9 in floating pt form'
Packit 1422b7
assert_output_json_eq '{"num": "15.9"}'
Packit 1422b7
Packit 1422b7
reset_rules
Packit 1422b7
Packit 1422b7
add_rule 'version=2'
Packit 1422b7
add_rule 'rule=:here is a negative number %{"name":"num", "type":"float"}% for you'
Packit 1422b7
execute 'here is a negative number -4.2 for you'
Packit 1422b7
assert_output_json_eq '{"num": "-4.2"}'
Packit 1422b7
Packit 1422b7
reset_rules
Packit 1422b7
Packit 1422b7
add_rule 'version=2'
Packit 1422b7
add_rule 'rule=:here is another real number %{"name":"real_no", "type":"float"}%.'
Packit 1422b7
execute 'here is another real number 2.71.'
Packit 1422b7
assert_output_json_eq '{"real_no": "2.71"}'
Packit 1422b7
Packit 1422b7
Packit 1422b7
cleanup_tmp_files
Packit 1422b7