From af8e680749e0276005e0d504560b3c98dbcd92e6 Mon Sep 17 00:00:00 2001 From: Yasmin Valim Date: Thu, 11 Apr 2024 10:07:44 -0300 Subject: [PATCH] v3_5_experimental: add validation, unit tests and error --- config/v3_5_experimental/types/config_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/v3_5_experimental/types/config_test.go b/config/v3_5_experimental/types/config_test.go index 3db9f6e3cf..73ae779d52 100644 --- a/config/v3_5_experimental/types/config_test.go +++ b/config/v3_5_experimental/types/config_test.go @@ -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 @@ -220,7 +220,6 @@ 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"}}, @@ -228,7 +227,7 @@ func TestConfigValidation(t *testing.T) { }, }, 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 @@ -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{