Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-asawicki committed Nov 27, 2024
1 parent ac4db15 commit de7e702
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/experiments/experiment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Test_experiments(t *testing.T) {
} {
output, err := maskOnCi(fmt.Sprintf(option, value))
require.NoError(t, err)
require.Equal(t, value, string(output))
require.Contains(t, value, string(output))

t.Logf("option %d: %s", idx+1, value)
}
Expand All @@ -63,11 +63,11 @@ func Test_experiments(t *testing.T) {

output, err := echoWithOutput(value)
require.NoError(t, err)
require.Equal(t, "***", string(output))
require.Equal(t, "***\n", string(output))

output, err = echoWithOutput("very secret info")
require.NoError(t, err)
require.Equal(t, "***", string(output))
require.Equal(t, "***\n", string(output))

output, err = echoWithOutput("secret info")
require.NoError(t, err)
Expand All @@ -90,14 +90,14 @@ func Test_experiments(t *testing.T) {

output, err := echoWithOutput(value)
require.NoError(t, err)
require.Equal(t, "*** *** *** ***", string(output))
require.Equal(t, "***\n***\n***\n***", string(output))

output, err = echoWithOutput("different space-separated really, really, really secret infos")
require.NoError(t, err)
require.Equal(t, "*** *** *** ***", string(output))
require.Equal(t, "*** *** *** ***\n", string(output))

output, err = echoWithOutput("different space-separatedreally, really,reallysecret infos")
require.NoError(t, err)
require.Equal(t, "************", string(output))
require.Equal(t, "************\n", string(output))
})
}

0 comments on commit de7e702

Please sign in to comment.