(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestJSONStringUtils(t *testing.T) { |
| 51 | tests := []struct { |
| 52 | input string |
| 53 | output string |
| 54 | }{ |
| 55 | {`test`, `"test"`}, |
| 56 | {`"test"`, `"\"test\""`}, |
| 57 | {"\x00", `"\u0000"`}, |
| 58 | } |
| 59 | |
| 60 | for _, test := range tests { |
| 61 | t.Run("ConvertToJSONString "+test.input, func(t *testing.T) { |
| 62 | out := ConvertToJSONString(test.input) |
| 63 | assert.Equal(t, test.output, out) |
| 64 | }) |
| 65 | t.Run("ConvertJSONString "+test.input, func(t *testing.T) { |
| 66 | out := ConvertJSONString(test.output) |
| 67 | assert.Equal(t, test.input, out) |
| 68 | }) |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func BenchmarkJSONStringUtils(b *testing.B) { |
| 73 | tests := []struct { |
nothing calls this directly
no test coverage detected