(t *testing.T)
| 301 | } |
| 302 | |
| 303 | func TestEscapeEscapedString(t *testing.T) { |
| 304 | tests := []struct { |
| 305 | input string |
| 306 | expected string |
| 307 | }{ |
| 308 | {"hello", "hello"}, |
| 309 | {"hello'world", "hello\\'world"}, |
| 310 | {"hello\\world", "hello\\\\world"}, |
| 311 | {"hello\nworld", "hello\\nworld"}, |
| 312 | {"hello\tworld", "hello\\tworld"}, |
| 313 | {"hello\rworld", "hello\\rworld"}, |
| 314 | } |
| 315 | |
| 316 | for _, tt := range tests { |
| 317 | t.Run(tt.input, func(t *testing.T) { |
| 318 | got := escapeEscapedString(tt.input) |
| 319 | if got != tt.expected { |
| 320 | t.Errorf("escapeEscapedString() = %v, want %v", got, tt.expected) |
| 321 | } |
| 322 | }) |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | func TestEscapeQuotedString(t *testing.T) { |
| 327 | tests := []struct { |
nothing calls this directly
no test coverage detected