(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func TestRandLetterBytes(t *testing.T) { |
| 28 | type args struct { |
| 29 | n int |
| 30 | } |
| 31 | tests := []struct { |
| 32 | name string |
| 33 | args args |
| 34 | want1 errors.Error |
| 35 | }{ |
| 36 | { |
| 37 | "test1", |
| 38 | args{0}, |
| 39 | nil, |
| 40 | }, |
| 41 | { |
| 42 | "test1", |
| 43 | args{-1}, |
| 44 | errors.Default.New("n must be greater than 0"), |
| 45 | }, |
| 46 | { |
| 47 | "test2", |
| 48 | args{10}, |
| 49 | nil, |
| 50 | }, |
| 51 | { |
| 52 | "test3", |
| 53 | args{128}, |
| 54 | nil, |
| 55 | }, |
| 56 | } |
| 57 | for _, tt := range tests { |
| 58 | t.Run(tt.name, func(t *testing.T) { |
| 59 | got, got1 := RandLetterBytes(tt.args.n) |
| 60 | t.Log(got) |
| 61 | assert.Equalf(t, tt.want1, got1, "RandLetterBytes(%v)", tt.args.n) |
| 62 | }) |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | func TestSanitizeString(t *testing.T) { |
| 67 | type args struct { |
nothing calls this directly
no test coverage detected