commit fa24290c5222d78238f8750c21a0004f0f0b6be5
parent 9267b7301f29ecd194ff10d009e5ab7a5989c578
Author: Florian Dold <florian.dold@gmail.com>
Date: Fri, 21 Aug 2020 16:41:27 +0530
test fallback
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/mustach/test_mustach_jansson.c b/src/mustach/test_mustach_jansson.c
@@ -65,6 +65,9 @@ main (int argc,
/* test 7 */
char *t7 = "amount: {{ amt!amount_decimal }} {{ amt!amount_currency }}";
char *x7 = "amount: 123.00 EUR";
+ /* test 8 */
+ char *t8 = "{{^ v4 }}fallback{{/ v4 }}";
+ char *x8 = "fallback";
/* contract test 8 (contract) */
char *tc = "summary: {{ summary!i18n }}";
@@ -73,6 +76,7 @@ main (int argc,
char *xc_fr = "summary: FRANCAISE";
json_object_set_new (root, "v1", json_string ("world"));
+ json_object_set_new (root, "v4", json_array ());
json_array_append_new (arr, json_string ("foo"));
json_array_append_new (arr, json_string ("bar"));
json_object_set_new (root, "v2", arr);
@@ -98,6 +102,7 @@ main (int argc,
assert_template (t5, root, x5);
assert_template (t6, root, x6);
assert_template (t7, root, x7);
+ assert_template (t8, root, x8);
assert_template (tc, contract, xc_en);