Skip to content
Myr

jq_fuzz_fixed: fix test cases that use string interpolation

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

"\(" is implementation-defined in C++, and both clang and gcc treat it as equivalent to "(", not "\\(". This patch replaces "\(" with "\\(" so that tests with string interpolation actually use string interpolation.

authored by Emanuele Torre · committed by GitHub · parent 5029328 · Browse files · 1 file+12 added−12 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+12 added−12 removed

  • tests:+12 added−12 removed

1 file+12 added−12 removed

modified:tests/jq_fuzz_fixed.cpp+12 added-12 removed
42 unmodified lines
43 ". as [$a, $b, {c: $c}] | $a + $b + $c",44 ".[] as {$a, $b, c: {$d}} ?// {$a, $b, c: [{$e}]} | {$a, $b, $d, $e}",45 ".[] as {$a, $b, c: {$d, $e}} ?// {$a, $b, c: [{$d, $e}]} | {$a, $b, "46 "$d, $e}",47 ".[] as [$a] ?// [$b] | if $a != null then error(\"err: \($a)\") else "47 ".[] as [$a] ?// [$b] | if $a != null then error(\"err: \\($a)\") else "48 "{$a,$b} end",49 ". as $big | [$big, $big + 1] | map(. > "50 "10000000000000000000000000000000)",51 ". as $dot|fromstream($dot|tostream)|.==$dot",
50 unmodified lines
102 "group_by(.foo)",103 "[.[] | gsub(\", \"; \":\")]",104 "gsub(\"$\"; \"a\"; \"g\")",105 "gsub(\"^\"; \"a\")",106 "[gsub(\"(?<a>.)\"; \"\(.a|ascii_upcase)\", \"\(.a|ascii_downcase)\", "106 "[gsub(\"(?<a>.)\"; \"\\(.a|ascii_upcase)\", \"\\(.a|ascii_downcase)\", "107 "\"c\")]",108 "gsub(\"^.*?a\"; \"b\")",109 "gsub(\"^.*a\"; \"b\")",110 "gsub(\"a\";\"b\")",111 "gsub(\"\"; \"a\"; \"g\")",112 "gsub(\"\"; \"a\"; \"g\")",113 "gsub(\"[^a-z]*(?<x>[a-z]*)\"; \"Z\(.x)\")",114 "gsub(\"\\b(?<x>.)\"; \"\(.x|ascii_downcase)\")",115 "gsub(\"(?<d>\\d)\"; \":\(.d);\")",113 "gsub(\"[^a-z]*(?<x>[a-z]*)\"; \"Z\\(.x)\")",114 "gsub(\"\\b(?<x>.)\"; \"\\(.x|ascii_downcase)\")",115 "gsub(\"(?<d>\\d)\"; \":\\(.d);\")",116 "gsub(\"^\"; \"\"; \"g\")",117 "[gsub(\"p\"; \"a\", \"b\")]",118 "gsub(\"(?=u)\"; \"u\")",119 "gsub(\"(.*)\"; \"\"; \"x\")",120 "gsub(\"(?<x>.)[^a]*\"; \"+\(.x)-\")",121 "gsub(\"(?<x>.)(?<y>[0-9])\"; \"\(.x|ascii_downcase)\(.y)\")",120 "gsub(\"(?<x>.)[^a]*\"; \"+\\(.x)-\")",121 "gsub(\"(?<x>.)(?<y>[0-9])\"; \"\\(.x|ascii_downcase)\\(.y)\")",122 "@html",123 "if . == 0 then \"zero\" elif . == 1 then \"one\" else \"many\" "124 "end",125 "implode",
79 unmodified lines
205 "(..|select(type==\"boolean\")) |= if . then 1 else 0 end",206 "setpath([0,\"a\"]; 1)",207 "setpath([\"a\",\"b\"]; 1)",208 "setpath([\"a\",\"b\"]; 1)",209 "@sh \"echo \(.)\"",209 "@sh \"echo \\(.)\"",210 "sort",211 "sort_by(.foo)",212 "sort_by(.foo, .bar)",213 "split(\", *\"; null)",
1 unmodified line
215 "sqrt",216 "[.[]|startswith(\"foo\")]",217 "strptime(\"%Y-%m-%dT%H:%M:%SZ\")",218 "strptime(\"%Y-%m-%dT%H:%M:%SZ\")|mktime",219 "[sub(\"(?<a>.)\"; \"\(.a|ascii_upcase)\", \"\(.a|ascii_downcase)\")]",220 "[sub(\"(?<a>.)\"; \"\(.a|ascii_upcase)\", \"\(.a|ascii_downcase)\", "219 "[sub(\"(?<a>.)\"; \"\\(.a|ascii_upcase)\", \"\\(.a|ascii_downcase)\")]",220 "[sub(\"(?<a>.)\"; \"\\(.a|ascii_upcase)\", \"\\(.a|ascii_downcase)\", "221 "\"c\")]",222 "[sub(\"a\"; \"b\", \"c\")]",223 "sub(\"[^a-z]*(?<x>[a-z]+)\"; \"Z\(.x)\"; \"g\")",223 "sub(\"[^a-z]*(?<x>[a-z]+)\"; \"Z\\(.x)\"; \"g\")",224 "[.[]|[[sub(\", *\";\":\")], [gsub(\", *\";\":\")], [scan(\", *\")]]]",225 "[.[]|[[sub(\", +\";\":\")], [gsub(\", +\";\":\")], [scan(\", +\")]]]",226 "sub(\"^(?<head>.)\"; \"Head=\(.head) Tail=\")",226 "sub(\"^(?<head>.)\"; \"Head=\\(.head) Tail=\")",227 "[test(\"ā\")]",228 ".[] | test(\"a b c # spaces are ignored\"; \"ix\")",229 "test(\"foo\")",230 "to_entries",
67 unmodified lines