| 787 | } |
| 788 | |
| 789 | func 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 | |
| 802 | func TestJQCorrectlyQueriesMultilineInputFields(t *testing.T) { |
| 803 | t.Parallel() |