MCPcopy Create free account
hub / github.com/stretchr/testify / TestStringEqual

Function TestStringEqual

assert/assertions_test.go:757–770  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

755}
756
757func 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
772func TestEqualFormatting(t *testing.T) {
773 for i, currCase := range []struct {

Callers

nothing calls this directly

Calls 3

EqualFunction · 0.70
RegexpFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected