Skip to content

Commit af8e680

Browse files
committed
v3_5_experimental: add validation, unit tests and error
1 parent d1c73de commit af8e680

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

config/v3_5_experimental/types/config_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func TestConfigValidation(t *testing.T) {
211211
},
212212
},
213213
out: errors.ErrPathConflictsParentDir,
214-
at: path.New("json", "storage", "links", 0, "path"),
214+
at: path.New("json", "storage", "links", 1, "path"),
215215
},
216216

217217
// test 8: file path conflicts with directory path, should error
@@ -220,15 +220,14 @@ func TestConfigValidation(t *testing.T) {
220220
Storage: Storage{
221221
Files: []File{
222222
{Node: Node{Path: "/foo/bar"}},
223-
{Node: Node{Path: "/foo/bar"}},
224223
},
225224
Directories: []Directory{
226225
{Node: Node{Path: "/foo/bar/baz"}},
227226
},
228227
},
229228
},
230229
out: errors.ErrPathConflictsParentDir,
231-
at: path.New("json", "storage", "directories", 0, "path"),
230+
at: path.New("json", "storage", "directories", 1, "path"),
232231
},
233232

234233
// test 9: non-conflicting scenarios with systemd unit and systemd dropin file, should not error
@@ -302,7 +301,6 @@ func TestConfigValidation(t *testing.T) {
302301
in: Config{
303302
Storage: Storage{
304303
Files: []File{
305-
{Node: Node{Path: "/foo/bar"}},
306304
{Node: Node{Path: "/foo/bar/baz"}},
307305
},
308306
Directories: []Directory{

0 commit comments

Comments
 (0)