Skip to content

Commit

Permalink
feat(test): update
Browse files Browse the repository at this point in the history
  • Loading branch information
Just-maple committed Oct 27, 2023
1 parent 7e86d16 commit 50e65b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func getGoenv(dir string) (env map[string]string, err error) {
continue
}
if kv := strings.SplitN(line, "=", 2); len(kv) >= 2 {
env[kv[0]], _ = strconv.Unquote(kv[1])
env[kv[0]], _ = strconv.Unquote(strings.Trim(kv[1], "'"))
}
}
return
Expand Down
9 changes: 8 additions & 1 deletion helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@ package main

import (
"os"
"runtime"
"testing"

zcore "github.com/go-zing/gozz-core"
)

func TestGetGoEnv(t *testing.T) {
_, err := getGoenv("./")
env, err := getGoenv("./")
if err != nil {
t.Fatal(err)
}
if env["GOARCH"] != runtime.GOARCH {
t.Fatalf("get value unexpected: %v != %v ", env["GOARCH"], runtime.GOARCH)
}
if env["GOOS"] != runtime.GOOS {
t.Fatalf("get value unexpected: %v != %v ", env["GOOS"], runtime.GOOS)
}
}

func TestGetCoreVersion(t *testing.T) {
Expand Down

0 comments on commit 50e65b7

Please sign in to comment.