(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func TestStringContains(t *testing.T) { |
| 129 | tests := []struct { |
| 130 | s string |
| 131 | substr string |
| 132 | expected bool |
| 133 | }{ |
| 134 | {"hello world", "world", true}, |
| 135 | {"hello world", "Hello", false}, |
| 136 | {"hello world", "o w", true}, |
| 137 | {"hello world", "", true}, |
| 138 | {"hello", "hello world", false}, |
| 139 | {"", "test", false}, |
| 140 | {"", "", true}, |
| 141 | } |
| 142 | |
| 143 | for _, test := range tests { |
| 144 | result := strings.Contains(test.s, test.substr) |
| 145 | if result != test.expected { |
| 146 | t.Errorf("strings.Contains(%q, %q) = %v, want %v", |
| 147 | test.s, test.substr, result, test.expected) |
| 148 | } |
| 149 | } |
| 150 | } |
nothing calls this directly
no outgoing calls
no test coverage detected