[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find ONE feature... #50
2 changed files with 28 additions and 0 deletions
|
|
@ -690,6 +690,8 @@ func TemplateFuncs() template.FuncMap {
|
|||
"progressSubject": ProgressSubject,
|
||||
"actionResult": ActionResult,
|
||||
"actionFailed": ActionFailed,
|
||||
"prompt": Prompt,
|
||||
"lang": Lang,
|
||||
"timeAgo": TimeAgo,
|
||||
"formatAgo": FormatAgo,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -879,6 +879,8 @@ func TestTemplateFuncs(t *testing.T) {
|
|||
"progressSubject",
|
||||
"actionResult",
|
||||
"actionFailed",
|
||||
"prompt",
|
||||
"lang",
|
||||
"timeAgo",
|
||||
"formatAgo",
|
||||
}
|
||||
|
|
@ -930,6 +932,30 @@ func TestTemplateFuncs_CompositeHelpers(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestTemplateFuncs_PromptAndLang(t *testing.T) {
|
||||
svc, err := New()
|
||||
if err != nil {
|
||||
t.Fatalf("New() failed: %v", err)
|
||||
}
|
||||
SetDefault(svc)
|
||||
|
||||
tmpl, err := template.New("").Funcs(TemplateFuncs()).Parse(
|
||||
`{{prompt "confirm"}}|{{lang "de"}}`,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("Parse() failed: %v", err)
|
||||
}
|
||||
|
||||
var buf strings.Builder
|
||||
if err := tmpl.Execute(&buf, nil); err != nil {
|
||||
t.Fatalf("Execute() failed: %v", err)
|
||||
}
|
||||
|
||||
if got, want := buf.String(), "Are you sure?|German"; got != want {
|
||||
t.Fatalf("template prompt/lang = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTemplateFuncs_TimeHelpers(t *testing.T) {
|
||||
svc, err := New()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue