
Match 'go test' behaviour and switch to package directory, unless one is specified with the '--wd' option. Fixes #2125
16 lines
196 B
Go
16 lines
196 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
os.Exit(m.Run())
|
|
}
|
|
|
|
func TestCurrentDirectory(t *testing.T) {
|
|
wd, _ := os.Getwd()
|
|
t.Logf("current directory: %s", wd)
|
|
}
|