Skip to content

Commit

Permalink
fix: minor changes requested by Alberto
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus committed Sep 24, 2024
1 parent 3d792c1 commit 939cbd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ func Select(release *Release, slices []SliceKey) (*Selection, error) {
}

// pathInfoToYAML converts a PathInfo object to a yamlPath object.
// The returned object is going to have pointers to the given PathInfo object.
// The returned object takes pointers to the given PathInfo object.
func pathInfoToYAML(pi *PathInfo) (*yamlPath, error) {
path := &yamlPath{
Mode: yamlMode(pi.Mode),
Expand Down
11 changes: 4 additions & 7 deletions internal/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1790,16 +1790,13 @@ func (s *S) TestPackageYAMLFormat(c *C) {
release, err := setup.ReadRelease(dir)
c.Assert(err, IsNil)

if test.expected == nil {
test.expected = test.input
}
for _, pkg := range release.Packages {
data, err := yaml.Marshal(pkg)
c.Assert(err, IsNil)
var expected string
if test.expected == nil || test.expected[pkg.Path] == "" {
expected = test.input[pkg.Path]
} else {
expected = test.expected[pkg.Path]
}
expected = string(testutil.Reindent(expected))
expected := string(testutil.Reindent(test.expected[pkg.Path]))
c.Assert(strings.TrimSpace(string(data)), Equals, strings.TrimSpace(expected))
}
}
Expand Down

0 comments on commit 939cbd6

Please sign in to comment.