internal/build:switch workdir from testpkg like go behavior

This commit is contained in:
luoliwoshang
2025-06-12 16:40:10 +08:00
parent 26aaa65c1d
commit 48bd1d46af
2 changed files with 12 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
package main
import "testing"
import (
"os"
"testing"
)
func TestZoo(t *testing.T) {
if Zoo() != 3 {
@@ -11,3 +14,10 @@ func TestZoo(t *testing.T) {
func TestFalse(t *testing.T) {
// t.Fatal("false")
}
func TestSwitchWd(t *testing.T) {
_, err := os.Stat("./foo")
if err != nil {
t.Fatal(err)
}
}