From 59d3e23fa40a2d313c840807f4ec052e2df07616 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 4 Jun 2010 10:54:18 +0200 Subject: [tests] add tests for 'null' values Signed-off-by: Michael Olbrich --- tests/basic_int32_test.sh | 2 ++ tests/complex_array_test.sh | 2 ++ tests/complex_dict_test.sh | 1 + 3 files changed, 5 insertions(+) diff --git a/tests/basic_int32_test.sh b/tests/basic_int32_test.sh index 649a016..a8be873 100755 --- a/tests/basic_int32_test.sh +++ b/tests/basic_int32_test.sh @@ -15,5 +15,7 @@ jdb_test_echo EchoINT32 i -1 && jdb_test_echo EchoINT32 i 42 && jdb_test_echo EchoINT32 i 2147483647 && jdb_test_echo EchoINT32 i -2147483648 && +jdb_test_echo EchoINT32 i null null "Unexpected 'null' parameter found." && +jdb_test_echo SumINT32 ii "23, null" null "Unexpected 'null' parameter found." && jdb_test_echo EchoINT32 i '"foo"' null "integer value expected." diff --git a/tests/complex_array_test.sh b/tests/complex_array_test.sh index f868396..cabd81c 100755 --- a/tests/complex_array_test.sh +++ b/tests/complex_array_test.sh @@ -16,6 +16,8 @@ jdb_test_echo EchoArray ai "[ 1, 2, 3, 42, 99, \"foo\" ]" null "integer value ex jdb_test_echo CountArray ai "[ 1, 2, 3, 42, 99, -42 ]" 6 && jdb_test_echo CountArray ai "[]" 0 && +jdb_test_echo CountArray ai "[ 1, null, 42]" null "unexpected 'null' element in json array." && + args="42" && for i in `seq 1 10`; do args="$args, $i, 1$i, 10$i, 100$i, 1000$i, 2$i, 20$i, 200$i, 2000$i, 3$i, 30$i, 300$i, 3000$i, 4$i, 40$i, 400$i, 4000$i, 5$i, 50$i, 500$i, 5000$i, $args" diff --git a/tests/complex_dict_test.sh b/tests/complex_dict_test.sh index da9621b..c3dd630 100755 --- a/tests/complex_dict_test.sh +++ b/tests/complex_dict_test.sh @@ -12,5 +12,6 @@ jdb_test_echo EchoDict 'a{si}' '{ "a": 1, "b": 2, "ff": 3, "y": 42, "x": 99, "foo": -42 }' && jdb_test_echo EchoDict 'a{si}' '{ "a": 1, "b": "2" }' null "integer value expected." && +jdb_test_echo EchoDict 'a{si}' '{ "a": 1, "b": null }' null "unexpected 'null' value in json object." && jdb_test_echo DictKeys 'a{si}' '{ "a": 1, "b": 2, "c": 55 }' '[ "a", "b", "c" ]' -- cgit v1.2.3