Blame tests/string_rb_simple_2_lines.sh
|
Packit |
1422b7 |
# This file is part of the liblognorm project, released under ASL 2.0
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
. $srcdir/exec.sh
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
test_def $0 "simple rulebase via string"
|
|
Packit |
1422b7 |
execute_with_string 'rule=:%w:word%
|
|
Packit |
1422b7 |
rule=:%n:number%' 'test'
|
|
Packit |
1422b7 |
assert_output_json_eq '{ "w": "test" }'
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
execute_with_string 'rule=:%w:word%
|
|
Packit |
1422b7 |
rule=:%n:number%' '2'
|
|
Packit |
1422b7 |
assert_output_json_eq '{ "n": "2" }'
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
#This is a correct word...
|
|
Packit |
1422b7 |
execute_with_string 'rule=:%w:word%
|
|
Packit |
1422b7 |
rule=:%n:number%' '2.3'
|
|
Packit |
1422b7 |
assert_output_json_eq '{ "w": "2.3" }'
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
#check error case
|
|
Packit |
1422b7 |
execute_with_string 'rule=:%w:word%
|
|
Packit |
1422b7 |
rule=:%n:number%' '2 3'
|
|
Packit |
1422b7 |
assert_output_json_eq '{ "originalmsg": "2 3", "unparsed-data": " 3" }'
|
|
Packit |
1422b7 |
|
|
Packit |
1422b7 |
cleanup_tmp_files
|