package cli import ( "os" "path/filepath" "testing" ) // TestMain isolates the cli test suite from the developer's real // ~/.config/lectio. Several reference/random tests assume English book // abbreviations (e.g. "Jn 3:16"); a user config with ui_language = pl makes // sigla_style = auto resolve to the Polish dialect, where "Jn" is not a valid // abbreviation, so those tests fail on such a developer's machine even though // they pass on a clean CI. Pointing LECTIO_CONFIG at a throwaway, // non-existent path forces the built-in defaults for every cli test and keeps // the suite from ever reading -- or writing -- the real user config. func TestMain(m *testing.M) { dir, err := os.MkdirTemp("", "lectio-cli-test") if err != nil { panic(err) } os.Setenv("LECTIO_CONFIG", filepath.Join(dir, "config.ini")) code := m.Run() os.RemoveAll(dir) os.Exit(code) }