From c5d32f625bd26ce2d418fe233e4b178614768bf9 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Wed, 3 Apr 2024 03:44:15 +0200 Subject: [PATCH] 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. --- internal/buffer/buffer_test.go | 2 +- internal/config/rtfiles_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/buffer/buffer_test.go b/internal/buffer/buffer_test.go index ce164729..7d7602e4 100644 --- a/internal/buffer/buffer_test.go +++ b/internal/buffer/buffer_test.go @@ -20,7 +20,7 @@ type operation struct { func init() { ulua.L = lua.NewState() - config.InitRuntimeFiles(true) + config.InitRuntimeFiles(false) config.InitGlobalSettings() config.GlobalSettings["backup"] = false config.GlobalSettings["fastdirty"] = true diff --git a/internal/config/rtfiles_test.go b/internal/config/rtfiles_test.go index 8b3f23d2..38c8e965 100644 --- a/internal/config/rtfiles_test.go +++ b/internal/config/rtfiles_test.go @@ -7,7 +7,7 @@ import ( ) func init() { - InitRuntimeFiles(true) + InitRuntimeFiles(false) } func TestAddFile(t *testing.T) {