cat demo/tests/concepts.json # Testing json output with regular should tests is not very convenient $ Regular text, rl1:directions.*east # With the 'j' modifier, data is interpreted as a json file $ With 'j' and a single ':', tests are on the keys 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 $ Tests can further be on number of elements in arrays and objects j>2:numbers j<7:concepts.winds j4:concepts.directions j5:concepts.wuxing $ With a second ':', an expression is tested on the values j:numbers:12 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 j<7:concepts.winds:foo $ Ignore case ('i') and regular expressions ('r') apply to the expression ji:concepts.directions:RtH jr:concepts.directions:no.th jr>1:concepts.directions:e.*?st $ Data that are not parsed as json yield 0 occurrences echo "hello, world" j0:hello