(t *testing.T)
| 159 | } |
| 160 | |
| 161 | func TestFixLoneBackslashesWindowsPath(t *testing.T) { |
| 162 | in := `{"filePath":"G:\src\file.py"}` |
| 163 | out := fixLoneBackslashes(in) |
| 164 | // \s 不是合法 JSON 转义 → 被双倍;Go json 接受 \f,\b 等控制字符,所以保留 |
| 165 | if !strings.Contains(out, `G:\\src`) { |
| 166 | t.Fatalf("output should escape lone \\s, got %q", out) |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | func TestFixLoneBackslashesPreservesValidEscapes(t *testing.T) { |
| 171 | in := `{"a":"line1\nline2","b":"quote: \"x\""}` |
nothing calls this directly
no test coverage detected