blob: f7e948df1e90c4247357076ef63c950b07901590 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package test_chdir
import (
"log"
"os"
"testing"
)
const file = "data.txt"
func init() {
_, err := os.Stat(file)
if err != nil {
log.Fatalf("in init(), could not stat %s: %v", file, err)
}
}
func TestMain(m *testing.M) {
_, err := os.Stat(file)
if err != nil {
log.Fatalf("in TestMain(), could not stat %s: %v", file, err)
}
os.Exit(m.Run())
}
func TestLocal(t *testing.T) {
_, err := os.Stat(file)
if err != nil {
t.Errorf("could not stat %s: %v", file, err)
}
}
|