MCPcopy Create free account
hub / github.com/chanced/caps / TestLowerFirst

Function TestLowerFirst

caps_test.go:542–572  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

540}
541
542func TestLowerFirst(t *testing.T) {
543 type Test struct {
544 input string
545 expected string
546 }
547 tests := []Test{
548 {"anExampleString", "anExampleString"},
549 {"ANEXAMPLESTRING", "aNEXAMPLESTRING"},
550 {"AnExampleString, ", "anExampleString, "},
551 {"a", "a"},
552 {"", ""},
553 {"123", "123"},
554 }
555
556 for _, test := range tests {
557 func(test Test) {
558 t.Run(test.input, func(t *testing.T) {
559 output := caps.LowerFirst(test.input)
560 if output != test.expected {
561 t.Errorf("expected \"%s\", got \"%s\"", test.expected, output)
562 }
563 })
564 t.Run("Caps::"+test.input, func(t *testing.T) {
565 output := caps.New().LowerFirst(test.input)
566 if output != test.expected {
567 t.Errorf("expected \"%s\", got \"%s\"", test.expected, output)
568 }
569 })
570 }(test)
571 }
572}
573
574func TestUpperFirst(t *testing.T) {
575 type Test struct {

Callers

nothing calls this directly

Calls 3

LowerFirstFunction · 0.92
NewFunction · 0.92
LowerFirstMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…