MCPcopy
hub / github.com/bitfield/script / TestJQCorrectlyQueriesMultilineInputArrays

Function TestJQCorrectlyQueriesMultilineInputArrays

script_test.go:815–826  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

813}
814
815func TestJQCorrectlyQueriesMultilineInputArrays(t *testing.T) {
816 t.Parallel()
817 input := `[1, 2, 3]` + "\n" + `[4, 5, 6]`
818 want := "1\n4\n"
819 got, err := script.Echo(input).JQ(".[0]").String()
820 if err != nil {
821 t.Fatal(err)
822 }
823 if want != got {
824 t.Error(cmp.Diff(want, got))
825 }
826}
827
828func TestJQErrorsWithInvalidQuery(t *testing.T) {
829 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StringMethod · 0.80
JQMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…