mirror of
https://github.com/golang/go
synced 2024-11-12 07:00:21 -07:00
io/ioutil: use _test not _obj in test
Fixes: make clean; make test R=gri CC=golang-dev https://golang.org/cl/2234044
This commit is contained in:
parent
81ba399a6a
commit
f3549d8323
@ -37,7 +37,7 @@ func TestReadFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestWriteFile(t *testing.T) {
|
func TestWriteFile(t *testing.T) {
|
||||||
filename := "_obj/rumpelstilzchen"
|
filename := "_test/rumpelstilzchen"
|
||||||
data := "Programming today is a race between software engineers striving to " +
|
data := "Programming today is a race between software engineers striving to " +
|
||||||
"build bigger and better idiot-proof programs, and the Universe trying " +
|
"build bigger and better idiot-proof programs, and the Universe trying " +
|
||||||
"to produce bigger and better idiots. So far, the Universe is winning."
|
"to produce bigger and better idiots. So far, the Universe is winning."
|
||||||
@ -74,19 +74,19 @@ func TestReadDir(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foundTest := false
|
foundTest := false
|
||||||
foundObj := false
|
foundTestDir := false
|
||||||
for _, dir := range list {
|
for _, dir := range list {
|
||||||
switch {
|
switch {
|
||||||
case dir.IsRegular() && dir.Name == "ioutil_test.go":
|
case dir.IsRegular() && dir.Name == "ioutil_test.go":
|
||||||
foundTest = true
|
foundTest = true
|
||||||
case dir.IsDirectory() && dir.Name == "_obj":
|
case dir.IsDirectory() && dir.Name == "_test":
|
||||||
foundObj = true
|
foundTestDir = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !foundTest {
|
if !foundTest {
|
||||||
t.Fatalf("ReadDir %s: test file not found", dirname)
|
t.Fatalf("ReadDir %s: test file not found", dirname)
|
||||||
}
|
}
|
||||||
if !foundObj {
|
if !foundTestDir {
|
||||||
t.Fatalf("ReadDir %s: _obj directory not found", dirname)
|
t.Fatalf("ReadDir %s: _test directory not found", dirname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user