summaryrefslogtreecommitdiffstats
path: root/tests/complex_variant_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/complex_variant_test.sh')
-rwxr-xr-xtests/complex_variant_test.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/complex_variant_test.sh b/tests/complex_variant_test.sh
new file mode 100755
index 0000000..8e0c81b
--- /dev/null
+++ b/tests/complex_variant_test.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. `dirname $0`/test_setup.sh "com.pengutronix.jdb.Test.Complex" || return
+
+jdb_test_echo EchoVariant v '[ "i", 42 ]' 42 &&
+jdb_test_echo EchoVariant v '[ "s", "foo" ]' '"foo"' &&
+jdb_test_echo EchoVariant v '[ "s", "42" ]' '"42"' &&
+
+jdb_test_echo EchoVariant v '[ "s", "foo", 33 ]' null "Unexpected extra parameter found." &&
+jdb_test_echo EchoVariant v '[ "si", "foo", 33 ]' null "invalid variant signature." &&
+
+jdb_test_echo EchoVariant v '[ "as", [ "42", "foobar"] ]' '[ "42", "foobar" ]' &&
+jdb_test_echo EchoVariantArray av '[ [ "i", 42 ], ["s", "foobar"] ]' '[ 42, "foobar" ]'
+