From 386ab6457bb9dd4901391ffe7ceb5fbe08705c09 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 22 Jan 2019 20:57:58 +0000 Subject: JSON: add jsons extract variant, to strip quotes from string results --- test/scripts/0000-Basic/0002 | 3 +++ test/stdout/0002 | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'test') 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: <> > > -- cgit v1.2.3