From 00742d538d624f813c460d69c480191d16b425b4 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Fri, 8 Nov 2024 18:25:08 +0600 Subject: [PATCH 1/8] fix: add missing "Generate" equivalency ``yamlPath.SameContent()`` seems to be missing checking for "Generate" equivalency. This commit adds that back. --- internal/setup/setup.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/setup/setup.go b/internal/setup/setup.go index 00337bb6..869d486f 100644 --- a/internal/setup/setup.go +++ b/internal/setup/setup.go @@ -445,7 +445,8 @@ func (yp *yamlPath) SameContent(other *yamlPath) bool { yp.Copy == other.Copy && yp.Text == other.Text && yp.Symlink == other.Symlink && - yp.Mutable == other.Mutable) + yp.Mutable == other.Mutable && + yp.Generate == other.Generate) } type yamlArch struct { From b9a0a4b5f2bc6dd4596b15f48728780edcbe18e2 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Fri, 22 Nov 2024 17:34:34 +0600 Subject: [PATCH 2/8] fix: add back missing changes Changes lost in merge commit. This commit adds back the lost changes. --- internal/setup/yaml.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/setup/yaml.go b/internal/setup/yaml.go index 3f46f713..f2dbe127 100644 --- a/internal/setup/yaml.go +++ b/internal/setup/yaml.go @@ -84,7 +84,8 @@ func (yp *yamlPath) SameContent(other *yamlPath) bool { yp.Copy == other.Copy && yp.Text == other.Text && yp.Symlink == other.Symlink && - yp.Mutable == other.Mutable) + yp.Mutable == other.Mutable && + yp.Generate == other.Generate) } type yamlArch struct { From 4c67e31fb3218f1872c580bdd620f6c5df7daf7f Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Mon, 25 Nov 2024 13:32:25 +0600 Subject: [PATCH 3/8] test: add tests for setup.yamlPath.SameContent() --- internal/setup/export_test.go | 4 +++ internal/setup/setup_test.go | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 internal/setup/export_test.go diff --git a/internal/setup/export_test.go b/internal/setup/export_test.go new file mode 100644 index 00000000..aae27c75 --- /dev/null +++ b/internal/setup/export_test.go @@ -0,0 +1,4 @@ +package setup + +type YAMLPath = yamlPath +type YAMLArch = yamlArch diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index 32e81428..49ec8e3b 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -2240,3 +2240,53 @@ func (s *S) TestParseSliceKey(c *C) { c.Assert(key, DeepEquals, test.expected) } } + +var sampleText = "sample" + +var yamlPathTests = []struct { + path1, path2 *setup.YAMLPath + areSame bool +}{{ + path1: &setup.YAMLPath{ + Text: &sampleText, + Mutable: true, + Mode: 0644, + Arch: setup.YAMLArch{List: []string{"amd64", "arm64"}}, + }, + path2: &setup.YAMLPath{ + Text: &sampleText, + Mutable: true, + Mode: 0644, + Arch: setup.YAMLArch{List: []string{"amd64", "arm64"}}, + }, + areSame: true, +}, { + path1: &setup.YAMLPath{Dir: true, Mode: 0755}, + path2: &setup.YAMLPath{Dir: true, Mode: 0755}, + areSame: true, +}, { + path1: &setup.YAMLPath{Symlink: "foo"}, + path2: &setup.YAMLPath{Symlink: "foo"}, + areSame: true, +}, { + path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, + path2: &setup.YAMLPath{Generate: setup.GenerateManifest}, + areSame: true, +}, { + // "until" is not checked. + path1: &setup.YAMLPath{Copy: "foo", Mutable: true, Until: setup.UntilMutate}, + path2: &setup.YAMLPath{Copy: "foo", Mutable: true}, + areSame: true, +}, { + // Empty texts produce nil Text pointer. + path1: &setup.YAMLPath{Text: nil}, + path2: &setup.YAMLPath{Text: nil}, + areSame: true, +}} + +func (s *S) TestYAMLPathSameContent(c *C) { + for _, test := range yamlPathTests { + areSame := test.path1.SameContent(test.path2) + c.Assert(areSame, Equals, test.areSame) + } +} From 1810c749d33144f93d26ac077a5b6c45bdc5a165 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Mon, 25 Nov 2024 17:38:53 +0600 Subject: [PATCH 4/8] test: add more tests, with new summaries --- internal/setup/setup_test.go | 87 ++++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 23 deletions(-) diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index 49ec8e3b..c08bc15f 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -2244,49 +2244,90 @@ func (s *S) TestParseSliceKey(c *C) { var sampleText = "sample" var yamlPathTests = []struct { + summary string path1, path2 *setup.YAMLPath - areSame bool + result bool }{{ - path1: &setup.YAMLPath{ - Text: &sampleText, - Mutable: true, - Mode: 0644, - Arch: setup.YAMLArch{List: []string{"amd64", "arm64"}}, - }, - path2: &setup.YAMLPath{ - Text: &sampleText, - Mutable: true, - Mode: 0644, - Arch: setup.YAMLArch{List: []string{"amd64", "arm64"}}, - }, - areSame: true, + summary: "Text path", + path1: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, + path2: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, + result: true, }, { + summary: "Dir path", path1: &setup.YAMLPath{Dir: true, Mode: 0755}, path2: &setup.YAMLPath{Dir: true, Mode: 0755}, - areSame: true, + result: true, }, { + summary: "Symlink path", path1: &setup.YAMLPath{Symlink: "foo"}, path2: &setup.YAMLPath{Symlink: "foo"}, - areSame: true, + result: true, }, { + summary: "Generate path", path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, path2: &setup.YAMLPath{Generate: setup.GenerateManifest}, - areSame: true, + result: true, +}, { + summary: "Copy path", + path1: &setup.YAMLPath{Copy: "foo"}, + path2: &setup.YAMLPath{Copy: "foo"}, + result: true, }, { - // "until" is not checked. + summary: `"arch" is not checked`, + path1: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"amd64"}}}, + path2: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"arm64"}}}, + result: true, +}, { + summary: `"until" is not checked`, path1: &setup.YAMLPath{Copy: "foo", Mutable: true, Until: setup.UntilMutate}, path2: &setup.YAMLPath{Copy: "foo", Mutable: true}, - areSame: true, + result: true, }, { - // Empty texts produce nil Text pointer. + summary: `Empty "text" produces nil pointer`, path1: &setup.YAMLPath{Text: nil}, path2: &setup.YAMLPath{Text: nil}, - areSame: true, + result: true, +}, { + summary: `Different "generate" values`, + path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, + path2: &setup.YAMLPath{Generate: setup.GenerateNone}, + result: false, +}, { + summary: `Different "text" pointers`, + path1: &setup.YAMLPath{Text: new(string)}, + path2: &setup.YAMLPath{Text: new(string)}, + result: false, +}, { + summary: `Different "copy" values`, + path1: &setup.YAMLPath{Copy: "foo"}, + path2: &setup.YAMLPath{Copy: "bar"}, + result: false, +}, { + summary: `Different "make" (Dir) values`, + path1: &setup.YAMLPath{Dir: true}, + path2: &setup.YAMLPath{Dir: false}, + result: false, +}, { + summary: `Different "symlink" values`, + path1: &setup.YAMLPath{Symlink: "foo"}, + path2: &setup.YAMLPath{Symlink: "bar"}, + result: false, +}, { + summary: `Different "mode" values`, + path1: &setup.YAMLPath{Text: nil, Mode: 0644}, + path2: &setup.YAMLPath{Text: nil, Mode: 0755}, + result: false, +}, { + summary: `Different "mutable" values`, + path1: &setup.YAMLPath{Text: nil, Mutable: true}, + path2: &setup.YAMLPath{Text: nil, Mutable: false}, + result: false, }} func (s *S) TestYAMLPathSameContent(c *C) { for _, test := range yamlPathTests { - areSame := test.path1.SameContent(test.path2) - c.Assert(areSame, Equals, test.areSame) + c.Logf("Summary: %s", test.summary) + result := test.path1.SameContent(test.path2) + c.Assert(result, Equals, test.result) } } From 167a6ebc5ea5a8742fb0a3dce39c41022c8c9608 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Mon, 25 Nov 2024 20:33:22 +0600 Subject: [PATCH 5/8] test: only add tests for GeneratePath Per offline comments, let's just have the SameContent tests for GeneratePath, because every other kind of paths are tested indirectly in slicer_test and setup_test. --- internal/setup/export_test.go | 1 - internal/setup/setup_test.go | 96 +++-------------------------------- 2 files changed, 8 insertions(+), 89 deletions(-) diff --git a/internal/setup/export_test.go b/internal/setup/export_test.go index aae27c75..35231e50 100644 --- a/internal/setup/export_test.go +++ b/internal/setup/export_test.go @@ -1,4 +1,3 @@ package setup type YAMLPath = yamlPath -type YAMLArch = yamlArch diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index c08bc15f..114dcfd7 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -2241,93 +2241,13 @@ func (s *S) TestParseSliceKey(c *C) { } } -var sampleText = "sample" +func (s *S) TestGeneratePathSameContent(c *C) { + path1 := &setup.YAMLPath{Generate: setup.GenerateManifest} + path2 := &setup.YAMLPath{Generate: setup.GenerateManifest} + result := path1.SameContent(path2) + c.Assert(result, Equals, true) -var yamlPathTests = []struct { - summary string - path1, path2 *setup.YAMLPath - result bool -}{{ - summary: "Text path", - path1: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, - path2: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, - result: true, -}, { - summary: "Dir path", - path1: &setup.YAMLPath{Dir: true, Mode: 0755}, - path2: &setup.YAMLPath{Dir: true, Mode: 0755}, - result: true, -}, { - summary: "Symlink path", - path1: &setup.YAMLPath{Symlink: "foo"}, - path2: &setup.YAMLPath{Symlink: "foo"}, - result: true, -}, { - summary: "Generate path", - path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, - path2: &setup.YAMLPath{Generate: setup.GenerateManifest}, - result: true, -}, { - summary: "Copy path", - path1: &setup.YAMLPath{Copy: "foo"}, - path2: &setup.YAMLPath{Copy: "foo"}, - result: true, -}, { - summary: `"arch" is not checked`, - path1: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"amd64"}}}, - path2: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"arm64"}}}, - result: true, -}, { - summary: `"until" is not checked`, - path1: &setup.YAMLPath{Copy: "foo", Mutable: true, Until: setup.UntilMutate}, - path2: &setup.YAMLPath{Copy: "foo", Mutable: true}, - result: true, -}, { - summary: `Empty "text" produces nil pointer`, - path1: &setup.YAMLPath{Text: nil}, - path2: &setup.YAMLPath{Text: nil}, - result: true, -}, { - summary: `Different "generate" values`, - path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, - path2: &setup.YAMLPath{Generate: setup.GenerateNone}, - result: false, -}, { - summary: `Different "text" pointers`, - path1: &setup.YAMLPath{Text: new(string)}, - path2: &setup.YAMLPath{Text: new(string)}, - result: false, -}, { - summary: `Different "copy" values`, - path1: &setup.YAMLPath{Copy: "foo"}, - path2: &setup.YAMLPath{Copy: "bar"}, - result: false, -}, { - summary: `Different "make" (Dir) values`, - path1: &setup.YAMLPath{Dir: true}, - path2: &setup.YAMLPath{Dir: false}, - result: false, -}, { - summary: `Different "symlink" values`, - path1: &setup.YAMLPath{Symlink: "foo"}, - path2: &setup.YAMLPath{Symlink: "bar"}, - result: false, -}, { - summary: `Different "mode" values`, - path1: &setup.YAMLPath{Text: nil, Mode: 0644}, - path2: &setup.YAMLPath{Text: nil, Mode: 0755}, - result: false, -}, { - summary: `Different "mutable" values`, - path1: &setup.YAMLPath{Text: nil, Mutable: true}, - path2: &setup.YAMLPath{Text: nil, Mutable: false}, - result: false, -}} - -func (s *S) TestYAMLPathSameContent(c *C) { - for _, test := range yamlPathTests { - c.Logf("Summary: %s", test.summary) - result := test.path1.SameContent(test.path2) - c.Assert(result, Equals, test.result) - } + path2.Generate = setup.GenerateNone + result = path1.SameContent(path2) + c.Assert(result, Equals, false) } From af5826443061eb617d7dd23a4a2d70890a429cd6 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Mon, 25 Nov 2024 21:24:40 +0600 Subject: [PATCH 6/8] Revert "test: only add tests for GeneratePath" This reverts commit 167a6ebc5ea5a8742fb0a3dce39c41022c8c9608. --- internal/setup/export_test.go | 1 + internal/setup/setup_test.go | 96 ++++++++++++++++++++++++++++++++--- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/internal/setup/export_test.go b/internal/setup/export_test.go index 35231e50..aae27c75 100644 --- a/internal/setup/export_test.go +++ b/internal/setup/export_test.go @@ -1,3 +1,4 @@ package setup type YAMLPath = yamlPath +type YAMLArch = yamlArch diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index 114dcfd7..c08bc15f 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -2241,13 +2241,93 @@ func (s *S) TestParseSliceKey(c *C) { } } -func (s *S) TestGeneratePathSameContent(c *C) { - path1 := &setup.YAMLPath{Generate: setup.GenerateManifest} - path2 := &setup.YAMLPath{Generate: setup.GenerateManifest} - result := path1.SameContent(path2) - c.Assert(result, Equals, true) +var sampleText = "sample" - path2.Generate = setup.GenerateNone - result = path1.SameContent(path2) - c.Assert(result, Equals, false) +var yamlPathTests = []struct { + summary string + path1, path2 *setup.YAMLPath + result bool +}{{ + summary: "Text path", + path1: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, + path2: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, + result: true, +}, { + summary: "Dir path", + path1: &setup.YAMLPath{Dir: true, Mode: 0755}, + path2: &setup.YAMLPath{Dir: true, Mode: 0755}, + result: true, +}, { + summary: "Symlink path", + path1: &setup.YAMLPath{Symlink: "foo"}, + path2: &setup.YAMLPath{Symlink: "foo"}, + result: true, +}, { + summary: "Generate path", + path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, + path2: &setup.YAMLPath{Generate: setup.GenerateManifest}, + result: true, +}, { + summary: "Copy path", + path1: &setup.YAMLPath{Copy: "foo"}, + path2: &setup.YAMLPath{Copy: "foo"}, + result: true, +}, { + summary: `"arch" is not checked`, + path1: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"amd64"}}}, + path2: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"arm64"}}}, + result: true, +}, { + summary: `"until" is not checked`, + path1: &setup.YAMLPath{Copy: "foo", Mutable: true, Until: setup.UntilMutate}, + path2: &setup.YAMLPath{Copy: "foo", Mutable: true}, + result: true, +}, { + summary: `Empty "text" produces nil pointer`, + path1: &setup.YAMLPath{Text: nil}, + path2: &setup.YAMLPath{Text: nil}, + result: true, +}, { + summary: `Different "generate" values`, + path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, + path2: &setup.YAMLPath{Generate: setup.GenerateNone}, + result: false, +}, { + summary: `Different "text" pointers`, + path1: &setup.YAMLPath{Text: new(string)}, + path2: &setup.YAMLPath{Text: new(string)}, + result: false, +}, { + summary: `Different "copy" values`, + path1: &setup.YAMLPath{Copy: "foo"}, + path2: &setup.YAMLPath{Copy: "bar"}, + result: false, +}, { + summary: `Different "make" (Dir) values`, + path1: &setup.YAMLPath{Dir: true}, + path2: &setup.YAMLPath{Dir: false}, + result: false, +}, { + summary: `Different "symlink" values`, + path1: &setup.YAMLPath{Symlink: "foo"}, + path2: &setup.YAMLPath{Symlink: "bar"}, + result: false, +}, { + summary: `Different "mode" values`, + path1: &setup.YAMLPath{Text: nil, Mode: 0644}, + path2: &setup.YAMLPath{Text: nil, Mode: 0755}, + result: false, +}, { + summary: `Different "mutable" values`, + path1: &setup.YAMLPath{Text: nil, Mutable: true}, + path2: &setup.YAMLPath{Text: nil, Mutable: false}, + result: false, +}} + +func (s *S) TestYAMLPathSameContent(c *C) { + for _, test := range yamlPathTests { + c.Logf("Summary: %s", test.summary) + result := test.path1.SameContent(test.path2) + c.Assert(result, Equals, test.result) + } } From 72b7e0b6b0318bda3d3efcf4436e54faaae520d4 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Mon, 25 Nov 2024 21:32:17 +0600 Subject: [PATCH 7/8] test: only add table tests for GeneratePath Per offline comments, let's just have the SameContent tests for GeneratePath, because every other kind of paths are tested indirectly in slicer_test and setup_test. Similar to 167a6eb, but do not remove the table tests. --- internal/setup/export_test.go | 1 - internal/setup/setup_test.go | 71 +---------------------------------- 2 files changed, 2 insertions(+), 70 deletions(-) diff --git a/internal/setup/export_test.go b/internal/setup/export_test.go index aae27c75..35231e50 100644 --- a/internal/setup/export_test.go +++ b/internal/setup/export_test.go @@ -1,4 +1,3 @@ package setup type YAMLPath = yamlPath -type YAMLArch = yamlArch diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index c08bc15f..87fe0837 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -2241,87 +2241,20 @@ func (s *S) TestParseSliceKey(c *C) { } } -var sampleText = "sample" - var yamlPathTests = []struct { summary string path1, path2 *setup.YAMLPath result bool }{{ - summary: "Text path", - path1: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, - path2: &setup.YAMLPath{Text: &sampleText, Mutable: true, Mode: 0644}, - result: true, -}, { - summary: "Dir path", - path1: &setup.YAMLPath{Dir: true, Mode: 0755}, - path2: &setup.YAMLPath{Dir: true, Mode: 0755}, - result: true, -}, { - summary: "Symlink path", - path1: &setup.YAMLPath{Symlink: "foo"}, - path2: &setup.YAMLPath{Symlink: "foo"}, - result: true, -}, { - summary: "Generate path", + summary: `Same "generate" value`, path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, path2: &setup.YAMLPath{Generate: setup.GenerateManifest}, result: true, }, { - summary: "Copy path", - path1: &setup.YAMLPath{Copy: "foo"}, - path2: &setup.YAMLPath{Copy: "foo"}, - result: true, -}, { - summary: `"arch" is not checked`, - path1: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"amd64"}}}, - path2: &setup.YAMLPath{Text: nil, Arch: setup.YAMLArch{List: []string{"arm64"}}}, - result: true, -}, { - summary: `"until" is not checked`, - path1: &setup.YAMLPath{Copy: "foo", Mutable: true, Until: setup.UntilMutate}, - path2: &setup.YAMLPath{Copy: "foo", Mutable: true}, - result: true, -}, { - summary: `Empty "text" produces nil pointer`, - path1: &setup.YAMLPath{Text: nil}, - path2: &setup.YAMLPath{Text: nil}, - result: true, -}, { - summary: `Different "generate" values`, + summary: `Different "generate" value`, path1: &setup.YAMLPath{Generate: setup.GenerateManifest}, path2: &setup.YAMLPath{Generate: setup.GenerateNone}, result: false, -}, { - summary: `Different "text" pointers`, - path1: &setup.YAMLPath{Text: new(string)}, - path2: &setup.YAMLPath{Text: new(string)}, - result: false, -}, { - summary: `Different "copy" values`, - path1: &setup.YAMLPath{Copy: "foo"}, - path2: &setup.YAMLPath{Copy: "bar"}, - result: false, -}, { - summary: `Different "make" (Dir) values`, - path1: &setup.YAMLPath{Dir: true}, - path2: &setup.YAMLPath{Dir: false}, - result: false, -}, { - summary: `Different "symlink" values`, - path1: &setup.YAMLPath{Symlink: "foo"}, - path2: &setup.YAMLPath{Symlink: "bar"}, - result: false, -}, { - summary: `Different "mode" values`, - path1: &setup.YAMLPath{Text: nil, Mode: 0644}, - path2: &setup.YAMLPath{Text: nil, Mode: 0755}, - result: false, -}, { - summary: `Different "mutable" values`, - path1: &setup.YAMLPath{Text: nil, Mutable: true}, - path2: &setup.YAMLPath{Text: nil, Mutable: false}, - result: false, }} func (s *S) TestYAMLPathSameContent(c *C) { From 16b49a76d737ff5aca50ed2da95e9e9728a560bc Mon Sep 17 00:00:00 2001 From: Alberto Carretero Date: Mon, 25 Nov 2024 17:34:40 +0100 Subject: [PATCH 8/8] add comment to clarify test rationale --- internal/setup/setup_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index 87fe0837..a5d16613 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -2241,7 +2241,12 @@ func (s *S) TestParseSliceKey(c *C) { } } -var yamlPathTests = []struct { +// This is an awkward test because right now the fact Generate is considered +// by SameContent is irrelevant to the implementation, because the code path +// happens to not touch it. More important than this test, there's an entry +// in setupTests that verifies that two packages with slices having +// {generate: manifest} in the same path are considered equal. +var yamlPathGenerateTests = []struct { summary string path1, path2 *setup.YAMLPath result bool @@ -2257,8 +2262,8 @@ var yamlPathTests = []struct { result: false, }} -func (s *S) TestYAMLPathSameContent(c *C) { - for _, test := range yamlPathTests { +func (s *S) TestYAMLPathGenerate(c *C) { + for _, test := range yamlPathGenerateTests { c.Logf("Summary: %s", test.summary) result := test.path1.SameContent(test.path2) c.Assert(result, Equals, test.result)