(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestEncoderStringNullEmpty2(t *testing.T) { |
| 202 | var testCases = []struct { |
| 203 | name string |
| 204 | baseJSON string |
| 205 | expectedJSON string |
| 206 | }{ |
| 207 | { |
| 208 | name: "basic 1st elem", |
| 209 | baseJSON: "[", |
| 210 | expectedJSON: `["test"`, |
| 211 | }, |
| 212 | } |
| 213 | for _, testCase := range testCases { |
| 214 | t.Run("true", func(t *testing.T) { |
| 215 | var b strings.Builder |
| 216 | var enc = NewEncoder(&b) |
| 217 | enc.writeString(testCase.baseJSON) |
| 218 | enc.StringNullEmpty("test") |
| 219 | enc.Write() |
| 220 | assert.Equal(t, testCase.expectedJSON, b.String()) |
| 221 | }) |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | func TestEncoderStringNullKeyEmpty(t *testing.T) { |
| 226 | var testCases = []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…