summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2019-01-22 20:57:58 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2019-01-22 20:57:58 +0000
commit386ab6457bb9dd4901391ffe7ceb5fbe08705c09 (patch)
tree1f56046bbf8dd0b3e92c2e8c06127eb7d88077b7 /test
parent1fa1333ca1a744ce7fa8af3fc73872b082631fe3 (diff)
JSON: add jsons extract variant, to strip quotes from string results
Diffstat (limited to 'test')
-rw-r--r--test/scripts/0000-Basic/00023
-rw-r--r--test/stdout/00025
2 files changed, 7 insertions, 1 deletions
diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index 7a9b38dba..397445273 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -893,6 +893,9 @@ ${extract json {Width} \
${extract json {2} {[116, 943, 234, 38793]} }
${extract json {2} {${extract json{IDs} {\{"other":"foo", "IDs": [116, 943, 234]\} }}} }
+${extract json {2} {["red", "green", "blue", "black"]} }
+${extract jsons{2} {["red", "green", "blue", "black"]} }
+
${extract json {seconds} { \{"hours":0, "mins":0, "seconds":59\} }}
${extract json {seconds} {${extract json {2} { ["irrelevant", \{"hours":0, "mins":0, "seconds":59\}] }}}}
diff --git a/test/stdout/0002 b/test/stdout/0002
index 44117a9fc..dd54b16eb 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -836,6 +836,9 @@ xyz
> 943
> 943
>
+> "green"
+> green
+>
> 59
> 59
>
@@ -845,7 +848,7 @@ xyz
> {"1":116, "2":943, "3":234}
> expect: {"1":116, "2":943, "3":234}
>
-> Failed: missing '"' wrapping string key for extract json
+> <>
> expect: <>
>
>