diff --git a/rc/rc_test.go b/rc/rc_test.go index 9843ce8a..d7f392aa 100644 --- a/rc/rc_test.go +++ b/rc/rc_test.go @@ -116,7 +116,7 @@ Cheating: func Compare(t *testing.T, argsAndSol map[string]string) { for args, sol := range argsAndSol { out, err := z01.MainOut("../rc", strings.Split(args, " ")...) - if out != sol && err != nil && err.Error() != sol { + if EqualResult(out, sol) && err != nil && EqualResult(err.Error(), sol) { fmt.Println(args, "\nError:", err) fmt.Println("Solution:", sol) // fmt.Println("Out:", out) @@ -124,3 +124,12 @@ func Compare(t *testing.T, argsAndSol map[string]string) { } } } + +func EqualResult(out, sol string) bool { + for _, v := range strings.Split(out, "\n") { + if strings.Contains(v, sol) { + return true + } + } + return false +}