From 0692fe6093c0d8e3d2011e83411365b08abbaf61 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 8 Sep 2021 21:00:16 +0800 Subject: [PATCH] fix test bug --- config_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config_test.go b/config_test.go index 8b9bd199..c2bf7f76 100644 --- a/config_test.go +++ b/config_test.go @@ -18,9 +18,14 @@ func TestNewConfig(t *testing.T) { return false } + xiangPath := os.Getenv("XIANG_PATH") + if xiangPath == "" { + xiangPath = "bin://xiang" + } + assert.Equal(t, cfg.Mode, os.Getenv("XIANG_MODE")) assert.Equal(t, cfg.Root, os.Getenv("XIANG_ROOT")) - assert.Equal(t, cfg.Path, os.Getenv("XIANG_PATH")) + assert.Equal(t, cfg.Path, xiangPath) assert.Equal(t, cfg.Service.Debug, vBool(os.Getenv("XIANG_SERVICE_DEBUG"))) assert.Equal(t, strings.Join(cfg.Service.Allow, "|"), os.Getenv("XIANG_SERVICE_ALLOW"))