aboutsummaryrefslogtreecommitdiff
path: root/tests/legacy/test_chdir/data_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/legacy/test_chdir/data_test.go')
-rw-r--r--tests/legacy/test_chdir/data_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/legacy/test_chdir/data_test.go b/tests/legacy/test_chdir/data_test.go
new file mode 100644
index 00000000..f7e948df
--- /dev/null
+++ b/tests/legacy/test_chdir/data_test.go
@@ -0,0 +1,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)
+ }
+}