summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/scripts/0000-Basic/000221
-rw-r--r--test/stdout/00029
2 files changed, 30 insertions, 0 deletions
diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index 27bf70806..65ce40b6a 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -874,6 +874,27 @@ ${if ={1}{1} {true}{${if ={1}{1} {true}{${if ={1}{1}{true}fail}}}}}
${env {USER}}
${env {NO_SUCH_VARIABLE} {oops, success} {correct}}
+# JSON
+
+${extract json {Url} \
+ { \{ \"Url\": \"http://www.example.com/image/481989943\",\
+ \"Height\": 125,\
+ \"Width\": 100\
+ \} \
+ } \
+ }
+${extract json {Width} \
+ { \{ \"Url\": \"http://www.example.com/image/481989943\",\
+ \"Height\": 125,\
+ \"Width\": 100\
+ \} \
+ } \
+ }
+${extract json {2} {[116, 943, 234, 38793]} }
+${extract json {2} {${extract json{IDs} {\{"other":"foo", "IDs": [116, 943, 234]\} }}} }
+
+${extract json {seconds} { \{"hours":0, "mins":0, "seconds":59\} }}
+${extract json {seconds} {${extract json {2} { ["irrelevant", \{"hours":0, "mins":0, "seconds":59\}] }}}}
****
# Test "escape" with print_topbitchars
exim -be -DPTBC=print_topbitchars
diff --git a/test/stdout/0002 b/test/stdout/0002
index 20f418360..a8d1361d1 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -829,6 +829,15 @@ xyz
> CALLER
> correct
>
+> # JSON
+>
+> "http://www.example.com/image/481989943"
+> 100
+> 943
+> 943
+>
+> 59
+> 59
>
> escape: B7·F2ò
>