Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
aooohan committed Mar 29, 2024
1 parent 1d42830 commit 5aa00f0
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions internal/plugin_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package internal

import (
"github.com/version-fox/vfox/internal/util"
"strings"
"testing"

Expand Down Expand Up @@ -227,12 +228,23 @@ func testHookFunc(t *testing.T, factory func() (*LuaPlugin, error)) {
t.Errorf("expected 2 paths, got %d", len(path))
}

if !strings.HasSuffix(path[0], "/bin") {
t.Errorf("expected PATH to end with '/bin', got '%s'", path[0])
}
if !strings.HasSuffix(path[1], "/bin2") {
t.Errorf("expected PATH to end with '/bin', got '%s'", path[1])
if util.GetOSType() == "windows" {
if !strings.HasSuffix(path[0], "\\bin") {
t.Errorf("expected PATH to end with '\\bin', got '%s'", path[0])
}
if !strings.HasSuffix(path[1], "\\bin2") {
t.Errorf("expected PATH to end with '\\bin2', got '%s'", path[1])
}

} else {
if !strings.HasSuffix(path[0], "/bin") {
t.Errorf("expected PATH to end with '/bin', got '%s'", path[0])
}
if !strings.HasSuffix(path[1], "/bin2") {
t.Errorf("expected PATH to end with '/bin2', got '%s'", path[1])
}
}

})

t.Run("PreUse", func(t *testing.T) {
Expand Down

0 comments on commit 5aa00f0

Please sign in to comment.