Skip to content

Commit c5d32f6

Browse files
committed
Ignore user-defined runtime files in buffer test and rtfiles test
When initializing runtime files (syntax files etc) in tests, initialize built-in runtime files only, to ensure that the tests are not affected by whatever is in ~/.config/micro/ on the test machine. micro_test.go already ensures that, by using its own temporary directory as an (empty) config directory. So we only need to fix buffer_test.go and rtfiles_test.go. In those tests, don't repeat the same dance with a temporary directory, instead just ignore the config directory.
1 parent baca0e5 commit c5d32f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/buffer/buffer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type operation struct {
2020

2121
func init() {
2222
ulua.L = lua.NewState()
23-
config.InitRuntimeFiles(true)
23+
config.InitRuntimeFiles(false)
2424
config.InitGlobalSettings()
2525
config.GlobalSettings["backup"] = false
2626
config.GlobalSettings["fastdirty"] = true

internal/config/rtfiles_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func init() {
10-
InitRuntimeFiles(true)
10+
InitRuntimeFiles(false)
1111
}
1212

1313
func TestAddFile(t *testing.T) {

0 commit comments

Comments
 (0)