Commit ab0e1d20 authored by Thonier's avatar Thonier Committed by Mathieu Giraud

demo/json.should: we should be able to test elements in nested lists

Reworked from examples by @flothoni.
See #54.
parent c7564848
......@@ -13,6 +13,8 @@ j:concepts.directions
j:concepts.wuxing.earth
j0:concepts.winds
j:numbers[3].meaning
j:numbers[4][0]
j0:numbers[4][4]
j0:numbers[0].meaning
j0:numbers[42].meaning
......@@ -28,6 +30,7 @@ j:concepts.directions:rth
j:concepts.directions[0]:rth
j0:concepts.directions[3]:rth
j0:concepts.wuxing:st
j:numbers[4][1]:0.8
$ The number of matching expressions can also be tested
j2:concepts.directions:st
......@@ -42,5 +45,3 @@ jr>1:concepts.directions:e.*?st
$ Data that are not parsed as json yield 0 occurrences
echo "hello, world"
j0:hello
{
"numbers" : [ 3, 7, 12, {"meaning": 42} ],
"numbers" : [ 3, 7, 12, {"meaning": 42}, [0, 0.8] ],
"concepts":
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment