(t *testing.T)
| 767 | } |
| 768 | |
| 769 | func Test_replaceInitialism(t *testing.T) { |
| 770 | type args struct { |
| 771 | s string |
| 772 | } |
| 773 | tests := []struct { |
| 774 | name string |
| 775 | args args |
| 776 | want string |
| 777 | }{ |
| 778 | { |
| 779 | name: "empty string", |
| 780 | args: args{s: ""}, |
| 781 | want: "", |
| 782 | }, |
| 783 | { |
| 784 | name: "no initialism", |
| 785 | args: args{s: "foo"}, |
| 786 | want: "foo", |
| 787 | }, |
| 788 | { |
| 789 | name: "one initialism", |
| 790 | args: args{s: "fooId"}, |
| 791 | want: "fooID", |
| 792 | }, |
| 793 | { |
| 794 | name: "two initialism", |
| 795 | args: args{s: "fooIdBarApi"}, |
| 796 | want: "fooIDBarAPI", |
| 797 | }, |
| 798 | { |
| 799 | name: "already initialism", |
| 800 | args: args{s: "fooIDBarAPI"}, |
| 801 | want: "fooIDBarAPI", |
| 802 | }, |
| 803 | { |
| 804 | name: "one initialism at start", |
| 805 | args: args{s: "idFoo"}, |
| 806 | want: "idFoo", |
| 807 | }, |
| 808 | { |
| 809 | name: "one initialism at start and one in middle", |
| 810 | args: args{s: "apiIdFoo"}, |
| 811 | want: "apiIDFoo", |
| 812 | }, |
| 813 | } |
| 814 | for _, tt := range tests { |
| 815 | t.Run(tt.name, func(t *testing.T) { |
| 816 | assert.Equalf(t, tt.want, replaceInitialism(tt.args.s), "replaceInitialism(%v)", tt.args.s) |
| 817 | }) |
| 818 | } |
| 819 | } |
nothing calls this directly
no test coverage detected