MCPcopy
hub / github.com/stretchr/testify / TestStringEqual

Function TestStringEqual

assert/assertions_test.go:787–802  ·  assert/assertions_test.go::TestStringEqual
(t *testing.T)

Source from the content-addressed store, hash-verified

785}
786
787func 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
804func TestEqualFormatting(t *testing.T) {
805 t.Parallel()

Callers

nothing calls this directly

Calls 3

EqualFunction · 0.70
RegexpFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected