MCPcopy Create free account
hub / github.com/aurora-develop/aurora / TestFixLoneBackslashesWindowsPath

Function TestFixLoneBackslashesWindowsPath

internal/toolcall/parser_test.go:161–168  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func 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
170func TestFixLoneBackslashesPreservesValidEscapes(t *testing.T) {
171 in := `{"a":"line1\nline2","b":"quote: \"x\""}`

Callers

nothing calls this directly

Calls 1

fixLoneBackslashesFunction · 0.85

Tested by

no test coverage detected