| 785 | } |
| 786 | |
| 787 | func TestStringEqual(t *testing.T) { |
| 788 | t.Parallel() |
| 789 | |
| 790 | for i, currCase := range []struct { |
| 791 | equalWant string |
| 792 | equalGot string |
| 793 | msgAndArgs []interface{} |
| 794 | want string |
| 795 | }{ |
| 796 | {equalWant: "hi, \nmy name is", equalGot: "what,\nmy name is", want: "\tassertions.go:\\d+: \n\t+Error Trace:\t\n\t+Error:\\s+Not equal:\\s+\n\\s+expected: \"hi, \\\\nmy name is\"\n\\s+actual\\s+: \"what,\\\\nmy name is\"\n\\s+Diff:\n\\s+-+ Expected\n\\s+\\++ Actual\n\\s+@@ -1,2 \\+1,2 @@\n\\s+-hi, \n\\s+\\+what,\n\\s+my name is"}, |
| 797 | } { |
| 798 | mockT := &bufferT{} |
| 799 | Equal(mockT, currCase.equalWant, currCase.equalGot, currCase.msgAndArgs...) |
| 800 | Regexp(t, regexp.MustCompile(currCase.want), mockT.buf.String(), "Case %d", i) |
| 801 | } |
| 802 | } |
| 803 | |
| 804 | func TestEqualFormatting(t *testing.T) { |
| 805 | t.Parallel() |