| 755 | } |
| 756 | |
| 757 | func TestStringEqual(t *testing.T) { |
| 758 | for i, currCase := range []struct { |
| 759 | equalWant string |
| 760 | equalGot string |
| 761 | msgAndArgs []interface{} |
| 762 | want string |
| 763 | }{ |
| 764 | {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"}, |
| 765 | } { |
| 766 | mockT := &bufferT{} |
| 767 | Equal(mockT, currCase.equalWant, currCase.equalGot, currCase.msgAndArgs...) |
| 768 | Regexp(t, regexp.MustCompile(currCase.want), mockT.buf.String(), "Case %d", i) |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | func TestEqualFormatting(t *testing.T) { |
| 773 | for i, currCase := range []struct { |