Skip to content

Commit

Permalink
v3_5_experimental: add validation, unit tests and error
Browse files Browse the repository at this point in the history
  • Loading branch information
yasminvalim committed Apr 11, 2024
1 parent d1c73de commit af8e680
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions config/v3_5_experimental/types/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestConfigValidation(t *testing.T) {
},
},
out: errors.ErrPathConflictsParentDir,
at: path.New("json", "storage", "links", 0, "path"),
at: path.New("json", "storage", "links", 1, "path"),
},

// test 8: file path conflicts with directory path, should error
Expand All @@ -220,15 +220,14 @@ func TestConfigValidation(t *testing.T) {
Storage: Storage{
Files: []File{
{Node: Node{Path: "/foo/bar"}},
{Node: Node{Path: "/foo/bar"}},
},
Directories: []Directory{
{Node: Node{Path: "/foo/bar/baz"}},
},
},
},
out: errors.ErrPathConflictsParentDir,
at: path.New("json", "storage", "directories", 0, "path"),
at: path.New("json", "storage", "directories", 1, "path"),
},

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

0 comments on commit af8e680

Please sign in to comment.