diff options
author | Nicolas Williams <nico@cryptonector.com> | 2013-11-28 22:36:14 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2013-12-04 18:21:39 -0600 |
commit | 5aadaa79ebd43bfba8d28d1e1487393085b64245 (patch) | |
tree | 33085275d0e03a0e464ffaad06c7054894f6fa08 | |
parent | cf562961b7fa35e13fbe8a4ac9a6d7836a0ecde9 (diff) |
Add tests for string division/splitting
-rw-r--r-- | tests/all.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/all.test b/tests/all.test index d6231ee8..72115818 100644 --- a/tests/all.test +++ b/tests/all.test @@ -583,10 +583,26 @@ def inc(x): x |= .+1; inc(.[].a) ["fo", "foo", "barfoo", "foobar", "barfoob"] [false, true, true, false, false] +[.[]|split(",")] +["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"] +[["a"," bc"," def"," ghij"," jklmn"," a","b"," c","d"," e","f"],["a","b","c","d"," e","f","g","h"]] + +[.[]|split(", ")] +["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"] +[["a","bc","def","ghij","jklmn","a,b","c,d","e,f"],["a,b,c,d","e,f,g,h"]] + [.[] * 3] ["a", "ab", "abc"] ["aaa", "ababab", "abcabcabc"] +[.[] / ","] +["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"] +[["a"," bc"," def"," ghij"," jklmn"," a","b"," c","d"," e","f"],["a","b","c","d"," e","f","g","h"]] + +[.[] / ", "] +["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"] +[["a","bc","def","ghij","jklmn","a,b","c,d","e,f"],["a,b,c,d","e,f,g,h"]] + map(.[1] as $needle | .[0] | contains($needle)) [[[],[]], [[1,2,3], [1,2]], [[1,2,3], [3,1]], [[1,2,3], [4]], [[1,2,3], [1,4]]] [true, true, true, false, false] |