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