(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestStringFromImmutableBytes(t *testing.T) { |
| 56 | tests := []struct { |
| 57 | name string |
| 58 | input []byte |
| 59 | want string |
| 60 | }{ |
| 61 | { |
| 62 | name: "abc", |
| 63 | input: []byte("abc"), |
| 64 | want: "abc", |
| 65 | }, |
| 66 | { |
| 67 | name: "empty", |
| 68 | input: []byte{}, |
| 69 | want: "", |
| 70 | }, |
| 71 | { |
| 72 | name: "nil", |
| 73 | input: nil, |
| 74 | want: "", |
| 75 | }, |
| 76 | } |
| 77 | |
| 78 | for _, tc := range tests { |
| 79 | t.Run(tc.name, func(t *testing.T) { |
| 80 | got := StringFromImmutableBytes(tc.input) |
| 81 | if got != tc.want { |
| 82 | t.Errorf("got %q want %q", got, tc.want) |
| 83 | } |
| 84 | }) |
| 85 | } |
| 86 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…