Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
  • Loading branch information
Wwwsylvia committed Jan 9, 2025
1 parent e4dc64e commit 373cfff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions content/file/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func Test_ensureBasePath(t *testing.T) {
if err := os.MkdirAll(filepath.Join(root, "hello world", "foo", "bar"), 0700); err != nil {
t.Fatal("failed to create temp folders:", err)
}
base := "hello world/foo"
baseRel := "hello world/foo"
baseAbs := filepath.Join(root, baseRel)

tests := []struct {
name string
Expand Down Expand Up @@ -155,7 +156,7 @@ func Test_ensureBasePath(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ensureBasePath(root, base, tt.target)
got, err := ensureBasePath(baseAbs, baseRel, tt.target)
if (err != nil) != tt.wantErr {
t.Errorf("ensureBasePath() error = %v, wantErr %v", err, tt.wantErr)
return
Expand All @@ -172,7 +173,8 @@ func Test_ensureLinkPath(t *testing.T) {
if err := os.MkdirAll(filepath.Join(root, "hello world", "foo", "bar"), 0700); err != nil {
t.Fatal("failed to create temp folders:", err)
}
base := "hello world/foo"
baseRel := "hello world/foo"
baseAbs := filepath.Join(root, baseRel)

tests := []struct {
name string
Expand Down Expand Up @@ -220,7 +222,7 @@ func Test_ensureLinkPath(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ensureLinkPath(root, base, tt.link, tt.target)
got, err := ensureLinkPath(baseAbs, baseRel, tt.link, tt.target)
if (err != nil) != tt.wantErr {
t.Errorf("ensureLinkPath() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down

0 comments on commit 373cfff

Please sign in to comment.