mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
Dont use a global var for mocking
This commit is contained in:
parent
86a6685446
commit
795bf7fb52
3 changed files with 8 additions and 8 deletions
|
|
@ -9,7 +9,6 @@ import (
|
|||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"kitty/tools/config"
|
||||
"kitty/tools/utils/shlex"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
|
@ -67,10 +66,8 @@ func TestParseSSHArgs(t *testing.T) {
|
|||
func TestRelevantKittyOpts(t *testing.T) {
|
||||
tdir := t.TempDir()
|
||||
path := filepath.Join(tdir, "kitty.conf")
|
||||
config.OverrideEffectiveConfigPath = path
|
||||
defer func() { config.OverrideEffectiveConfigPath = "" }()
|
||||
os.WriteFile(path, []byte("term XXX\nshell_integration changed\nterm abcd"), 0o600)
|
||||
rko := read_relevant_kitty_opts()
|
||||
rko := read_relevant_kitty_opts(path)
|
||||
if rko.Term != "abcd" {
|
||||
t.Fatalf("Unexpected TERM: %s", RelevantKittyOpts().Term)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue