Skip to content

Commit

Permalink
use assert.Contains for result.OneLiner() check
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthpun committed Dec 13, 2023
1 parent cfc51e9 commit cce9976
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/test/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,18 @@ Seed: 1521
assert.NoError(t, result.Results[scriptPassing.Filename][0].Error)
assert.Error(t, result.Results[scriptFailing.Filename][0].Error)
assert.ErrorAs(t, result.Results[scriptFailing.Filename][0].Error, &stdlib.AssertionError{})
assert.Equal(

assert.Contains(
t,
result.Oneliner(),
"Test results: \"./testScriptSimple.cdc\"\n- PASS: testSimple",
)
assert.Contains(
t,
"Test results: \"./testScriptSimple.cdc\"\n- PASS: testSimple\nTest results: \"./testScriptSimpleFailing.cdc\"\n- FAIL: testSimple\n\t\tExecution failed:\n\t\t\terror: assertion failed\n\t\t\t --> 7465737400000000000000000000000000000000000000000000000000000000:5:12\n\t\t\t\n",
result.Oneliner(),
"Test results: \"./testScriptSimpleFailing.cdc\"\n- FAIL: "+
"testSimple\n\t\tExecution failed:\n\t\t\terror: assertion failed\n"+
"\t\t\t --> 7465737400000000000000000000000000000000000000000000000000000000:5:12",
)
})

Expand Down

0 comments on commit cce9976

Please sign in to comment.