(t *testing.T)
| 540 | } |
| 541 | |
| 542 | func 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 | |
| 574 | func TestUpperFirst(t *testing.T) { |
| 575 | type Test struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…