From cce9976dc5f01e0f9bc213c17662307f6d7d91e2 Mon Sep 17 00:00:00 2001 From: Ian Pun Date: Tue, 12 Dec 2023 16:36:31 -0800 Subject: [PATCH] use assert.Contains for result.OneLiner() check --- internal/test/test_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/test/test_test.go b/internal/test/test_test.go index 29d70f55c..653f7b681 100644 --- a/internal/test/test_test.go +++ b/internal/test/test_test.go @@ -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", ) })