Skip to content

Commit

Permalink
filter_test: more carefully test all the highlight cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed Jun 29, 2022
1 parent db1002e commit c146a67
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/parse/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ func TestJQ(t *testing.T) {
wantFiltered: true,
wantErr: nil,
},
{
jq: `highlight(true)`,
l: referenceLine(),
wantLine: func() *line { l := referenceLine(); l.highlight = true; return l }(),
},
{
jq: `highlight(false)`,
l: referenceLine(),
wantLine: referenceLine(),
},
{
jq: `highlight(42)`,
l: referenceLine(),
wantLine: referenceLine(),
wantErr: Match("should be a boolean"),
},
}
for _, test := range testData {
t.Run(test.jq, func(t *testing.T) {
Expand Down

0 comments on commit c146a67

Please sign in to comment.