Skip to content
Myr

Add tests for built-in function `contains`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Haguenauer · committed by Nico Williams · parent 61cd6db · Browse files · 1 file+20 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+20 added−3 removed

  • tests:+20 added−3 removed

1 file+20 added−3 removed

modified:tests/jq.test+20 added-3 removed
1090 unmodified lines
1091{}1092[true, true, false]10931094# containment operator (embedded NULs!)1095[contains("foo"), contains("\u0000b"), contains("\u0000z"), contains("bar"), contains("baz")]1096"foo\u0000bar"1097[true, true, false, true, false]1095[contains(""), contains("\u0000")]1096"\u0000"1097[true, true]10981099[contains(""), contains("a"), contains("ab"), contains("c"), contains("d")]1100"ab\u0000cd"1101[true, true, true, true, true]11021103[contains("cd"), contains("b\u0000"), contains("ab\u0000")]1104"ab\u0000cd"1105[true, true, true]11061107[contains("b\u0000c"), contains("b\u0000cd"), contains("b\u0000cd")]1108"ab\u0000cd"1109[true, true, true]11101111[contains("@"), contains("\u0000@"), contains("\u0000what")]1112"ab\u0000cd"1113[false, false, false]111411151116# Try/catch and general `?` operator1117[.[]|try if . == 0 then error("foo") elif . == 1 then .a elif . == 2 then empty else . end catch .]1118[0,1,2,3]1119["foo","Cannot index number with string \"a\"",3]
422 unmodified lines