MCPcopy Create free account
hub / github.com/gobeam/stringy / TestInput_ReplaceFirst

Function TestInput_ReplaceFirst

stringy_test.go:243–249  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

241}
242
243func TestInput_ReplaceFirst(t *testing.T) {
244 replaceFirst := New("Hello My name is Roshan and his name is Alis.")
245 against := "Hello My nombre is Roshan and his name is Alis."
246 if result := replaceFirst.ReplaceFirst("name", "nombre"); result != against {
247 t.Errorf("Expected: %s but got: %s", against, result)
248 }
249}
250
251func TestInput_ReplaceFirstEmptyInput(t *testing.T) {
252 replaceFirst := New("")

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
ReplaceFirstMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…