Skip to content

Commit 19ff607

Browse files
author
xiao
committed
move checks in two tests to TestModule7Import(); remove the two tests
1 parent c5da0c4 commit 19ff607

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

module7/module7_test.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,22 @@ func TestModule7gogenerate(t *testing.T) {
1818

1919
func TestModule7Import(t *testing.T) {
2020
found := OpenFileAndFindString("module7_code.go", "import (")
21-
2221
if !found {
2322
t.Errorf("import not found")
23+
return
2424
}
25-
}
26-
27-
func TestModule7ImportFmt(t *testing.T) {
28-
found := OpenFileAndFindString("module7_code.go", " \"fmt\"")
2925

26+
found = OpenFileAndFindString("module7_code.go", " \"fmt\"")
3027
if !found {
3128
t.Errorf("package 'fmt' not imported")
29+
return
3230
}
33-
}
3431

35-
func TestModule7ImportRuntime(t *testing.T) {
36-
found := OpenFileAndFindString("module7_code.go", " \"runtime\"")
32+
found = OpenFileAndFindString("module7_code.go", " \"runtime\"")
3733

3834
if !found {
3935
t.Errorf("package 'runtime' not imported")
36+
return
4037
}
4138
}
4239

0 commit comments

Comments
 (0)