[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find features de... #141
2 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package i18n
|
|||
|
||||
import (
|
||||
"maps"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
"unicode"
|
||||
|
|
@ -742,7 +743,7 @@ func renderWordOrTitle(lang, word string) string {
|
|||
|
||||
// Quote wraps a string in double quotes.
|
||||
func Quote(s string) string {
|
||||
return `"` + s + `"`
|
||||
return strconv.Quote(s)
|
||||
}
|
||||
|
||||
// ArticlePhrase prefixes a noun phrase with the correct article.
|
||||
|
|
|
|||
|
|
@ -511,6 +511,9 @@ func TestQuote(t *testing.T) {
|
|||
if got := Quote("hello"); got != `"hello"` {
|
||||
t.Errorf("Quote(%q) = %q, want %q", "hello", got, `"hello"`)
|
||||
}
|
||||
if got := Quote(`a "quoted" path\name`); got != `"a \"quoted\" path\\name"` {
|
||||
t.Errorf("Quote(%q) = %q, want %q", `a "quoted" path\name`, got, `"a \"quoted\" path\\name"`)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCaseHelpers(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue