@@ -30,19 +30,19 @@ import (
3030
3131// All can be used as a parameter for expected.Output to group a set of comparators.
3232func All (comparators ... test.Comparator ) test.Comparator {
33- return func (stdout , _ string , t * testing.T ) {
33+ return func (stdout string , t * testing.T ) {
3434 t .Helper ()
3535
3636 for _ , comparator := range comparators {
37- comparator (stdout , "" , t )
37+ comparator (stdout , t )
3838 }
3939 }
4040}
4141
4242// Contains can be used as a parameter for expected.Output and ensures a comparison string is found contained in the
4343// output.
4444func Contains (compare string , more ... string ) test.Comparator {
45- return func (stdout , _ string , t * testing.T ) {
45+ return func (stdout string , t * testing.T ) {
4646 t .Helper ()
4747
4848 assertive .Contains (assertive .WithFailLater (t ), stdout , compare , "Inspecting output (contains)" )
@@ -55,7 +55,7 @@ func Contains(compare string, more ...string) test.Comparator {
5555
5656// DoesNotContain is to be used for expected.Output to ensure a comparison string is NOT found in the output.
5757func DoesNotContain (compare string , more ... string ) test.Comparator {
58- return func (stdout , _ string , t * testing.T ) {
58+ return func (stdout string , t * testing.T ) {
5959 t .Helper ()
6060
6161 assertive .DoesNotContain (assertive .WithFailLater (t ), stdout , compare , "Inspecting output (does not contain)" )
@@ -68,31 +68,31 @@ func DoesNotContain(compare string, more ...string) test.Comparator {
6868
6969// Equals is to be used for expected.Output to ensure it is exactly the output.
7070func Equals (compare string ) test.Comparator {
71- return func (stdout , _ string , t * testing.T ) {
71+ return func (stdout string , t * testing.T ) {
7272 t .Helper ()
7373 assertive .IsEqual (assertive .WithFailLater (t ), stdout , compare , "Inspecting output (equals)" )
7474 }
7575}
7676
7777// Match is to be used for expected.Output to ensure we match a regexp.
7878func Match (reg * regexp.Regexp ) test.Comparator {
79- return func (stdout , _ string , t * testing.T ) {
79+ return func (stdout string , t * testing.T ) {
8080 t .Helper ()
8181 assertive .Match (assertive .WithFailLater (t ), stdout , reg , "Inspecting output (match)" )
8282 }
8383}
8484
8585// JSON allows to verify that the output can be marshalled into T, and optionally can be further verified by a provided
8686// method.
87- func JSON [T any ](obj T , verifier func (T , string , tig.T )) test.Comparator {
88- return func (stdout , _ string , t * testing.T ) {
87+ func JSON [T any ](obj T , verifier func (T , tig.T )) test.Comparator {
88+ return func (stdout string , t * testing.T ) {
8989 t .Helper ()
9090
9191 err := json .Unmarshal ([]byte (stdout ), & obj )
9292 assertive .ErrorIsNil (assertive .WithSilentSuccess (t ), err , "Unmarshalling JSON from stdout must succeed" )
9393
9494 if verifier != nil && err == nil {
95- verifier (obj , "Inspecting output (JSON)" , t )
95+ verifier (obj , t )
9696 }
9797 }
9898}
0 commit comments