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

Function TestJQHandlesGithubJSONWithRealWorldExampleQuery

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

Source from the content-addressed store, hash-verified

787}
788
789func TestJQHandlesGithubJSONWithRealWorldExampleQuery(t *testing.T) {
790 t.Parallel()
791 want := `{"message":"restore sample log data (fixes #102)","name":"John Arundel"}` + "\n"
792 got, err := script.File("testdata/commits.json").
793 JQ(".[0] | {message: .commit.message, name: .commit.committer.name}").String()
794 if err != nil {
795 t.Fatal(err)
796 }
797 if want != got {
798 t.Error(cmp.Diff(want, got))
799 }
800}
801
802func TestJQCorrectlyQueriesMultilineInputFields(t *testing.T) {
803 t.Parallel()

Callers

nothing calls this directly

Calls 4

FileFunction · 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…