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

Function TestJQCorrectlyQueriesMultilineInputFields

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

Source from the content-addressed store, hash-verified

800}
801
802func TestJQCorrectlyQueriesMultilineInputFields(t *testing.T) {
803 t.Parallel()
804 input := `{"a":1}` + "\n" + `{"a":2}`
805 want := "1\n2\n"
806 got, err := script.Echo(input).JQ(".a").String()
807 if err != nil {
808 t.Fatal(err)
809 }
810 if want != got {
811 t.Error(cmp.Diff(want, got))
812 }
813}
814
815func TestJQCorrectlyQueriesMultilineInputArrays(t *testing.T) {
816 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…