X Tutup
Skip to content

Commit 3d1fdac

Browse files
committed
config_test: sort result before check
config imports is in random order after LoadConfig call so that the testing check should be done after sort.Strings(out.Imports). Signed-off-by: Wei Fu <fuweid89@gmail.com>
1 parent 59a625d commit 3d1fdac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

services/server/config/config_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"io/ioutil"
2121
"os"
2222
"path/filepath"
23+
"sort"
2324
"testing"
2425

2526
"gotest.tools/assert"
@@ -175,6 +176,7 @@ imports = ["data1.toml", "data2.toml"]
175176
assert.Equal(t, "/var/lib/containerd", out.Root)
176177
assert.DeepEqual(t, []string{"io.containerd.v1.xyz"}, out.DisabledPlugins)
177178

179+
sort.Strings(out.Imports)
178180
assert.DeepEqual(t, []string{
179181
filepath.Join(tempDir, "data1.toml"),
180182
filepath.Join(tempDir, "data2.toml"),

0 commit comments

Comments
 (0)
X Tutup