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

Function TestInput_Prefix

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

Source from the content-addressed store, hash-verified

389}
390
391func TestInput_Prefix(t *testing.T) {
392 str := New("foobar")
393 against := "foobar"
394 if val := str.Prefix("foo"); val != against {
395 t.Errorf("Expected: to be %s but got: %s", against, val)
396 }
397
398 str = New("foobar")
399 against = "foofoofoobar"
400 if val := str.Prefix("foofoo"); val != against {
401 t.Errorf("Expected: to be %s but got: %s", against, val)
402 }
403}
404
405func TestInput_Suffix(t *testing.T) {
406 str := New("foobar")

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
PrefixMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…