| 1 | { |
| 2 | "tests": [ |
| 3 | { |
| 4 | "name": "space between question mark and expression", |
| 5 | "selector" : "$[? @.a]", |
| 6 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 7 | "result": [ |
| 8 | {"a": "b", "d": "e"} |
| 9 | ] |
| 10 | }, |
| 11 | { |
| 12 | "name": "newline between question mark and expression", |
| 13 | "selector" : "$[?\n@.a]", |
| 14 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 15 | "result": [ |
| 16 | {"a": "b", "d": "e"} |
| 17 | ] |
| 18 | }, |
| 19 | { |
| 20 | "name": "tab between question mark and expression", |
| 21 | "selector" : "$[?\t@.a]", |
| 22 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 23 | "result": [ |
| 24 | {"a": "b", "d": "e"} |
| 25 | ] |
| 26 | }, |
| 27 | { |
| 28 | "name": "return between question mark and expression", |
| 29 | "selector" : "$[?\r@.a]", |
| 30 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 31 | "result": [ |
| 32 | {"a": "b", "d": "e"} |
| 33 | ] |
| 34 | }, |
| 35 | { |
| 36 | "name": "space between question mark and parenthesized expression", |
| 37 | "selector" : "$[? (@.a)]", |
| 38 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 39 | "result": [ |
| 40 | {"a": "b", "d": "e"} |
| 41 | ] |
| 42 | }, |
| 43 | { |
| 44 | "name": "newline between question mark and parenthesized expression", |
| 45 | "selector" : "$[?\n(@.a)]", |
| 46 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 47 | "result": [ |
| 48 | {"a": "b", "d": "e"} |
| 49 | ] |
| 50 | }, |
| 51 | { |
| 52 | "name": "tab between question mark and parenthesized expression", |
| 53 | "selector" : "$[?\t(@.a)]", |
| 54 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 55 | "result": [ |
| 56 | {"a": "b", "d": "e"} |
| 57 | ] |
| 58 | }, |
| 59 | { |
| 60 | "name": "return between question mark and parenthesized expression", |
| 61 | "selector" : "$[?\r(@.a)]", |
| 62 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 63 | "result": [ |
| 64 | {"a": "b", "d": "e"} |
| 65 | ] |
| 66 | }, |
| 67 | { |
| 68 | "name": "space between parenthesized expression and bracket", |
| 69 | "selector" : "$[?(@.a) ]", |
| 70 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 71 | "result": [ |
| 72 | {"a": "b", "d": "e"} |
| 73 | ] |
| 74 | }, |
| 75 | { |
| 76 | "name": "newline between parenthesized expression and bracket", |
| 77 | "selector" : "$[?(@.a)\n]", |
| 78 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 79 | "result": [ |
| 80 | {"a": "b", "d": "e"} |
| 81 | ] |
| 82 | }, |
| 83 | { |
| 84 | "name": "tab between parenthesized expression and bracket", |
| 85 | "selector" : "$[?(@.a)\t]", |
| 86 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 87 | "result": [ |
| 88 | {"a": "b", "d": "e"} |
| 89 | ] |
| 90 | }, |
| 91 | { |
| 92 | "name": "return between parenthesized expression and bracket", |
| 93 | "selector" : "$[?(@.a)\r]", |
| 94 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 95 | "result": [ |
| 96 | {"a": "b", "d": "e"} |
| 97 | ] |
| 98 | }, |
| 99 | { |
| 100 | "name": "space between bracket and question mark", |
| 101 | "selector" : "$[ [email protected]]", |
| 102 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 103 | "result": [ |
| 104 | {"a": "b", "d": "e"} |
| 105 | ] |
| 106 | }, |
| 107 | { |
| 108 | "name": "newline between bracket and question mark", |
| 109 | "selector" : "$[\n[email protected]]", |
| 110 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 111 | "result": [ |
| 112 | {"a": "b", "d": "e"} |
| 113 | ] |
| 114 | }, |
| 115 | { |
| 116 | "name": "tab between bracket and question mark", |
| 117 | "selector" : "$[\t[email protected]]", |
| 118 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 119 | "result": [ |
| 120 | {"a": "b", "d": "e"} |
| 121 | ] |
| 122 | }, |
| 123 | { |
| 124 | "name": "return between bracket and question mark", |
| 125 | "selector" : "$[\r[email protected]]", |
| 126 | "document" : [{"a": "b", "d": "e"}, {"b": "c", "d": "f"}], |
| 127 | "result": [ |
| 128 | {"a": "b", "d": "e"} |
| 129 | ] |
| 130 | } |
| 131 | ] |
| 132 | } |