MCPcopy Create free account
hub / github.com/diillson/chatcli / TestMain

Function TestMain

cli/config_sections_test.go:17–22  ·  view source on GitHub ↗

TestMain ensures i18n is initialized before any test runs so T() returns real translations instead of the raw key strings.

(m *testing.M)

Source from the content-addressed store, hash-verified

15// TestMain ensures i18n is initialized before any test runs so T() returns
16// real translations instead of the raw key strings.
17func TestMain(m *testing.M) {
18 // Force English for stable, locale-independent test assertions.
19 _ = os.Setenv("CHATCLI_LANG", "en")
20 i18n.Init()
21 os.Exit(m.Run())
22}
23
24// captureStdout swaps os.Stdout for a pipe, runs fn, and returns the
25// captured output. Used to assert that each /config section renders without

Callers

nothing calls this directly

Calls 2

InitFunction · 0.92
RunMethod · 0.65

Tested by

no test coverage detected