fix spelling mistake again
Signed-off-by: Mageee <fangpuyi@foxmail.com>
| ... | ... |
@@ -3,6 +3,7 @@ package main |
| 3 | 3 |
import ( |
| 4 | 4 |
"strings" |
| 5 | 5 |
|
| 6 |
+ "github.com/docker/docker/pkg/integration/checker" |
|
| 6 | 7 |
"github.com/go-check/check" |
| 7 | 8 |
) |
| 8 | 9 |
|
| ... | ... |
@@ -21,9 +22,7 @@ func (s *DockerSuite) TestVersionEnsureSucceeds(c *check.C) {
|
| 21 | 21 |
} |
| 22 | 22 |
|
| 23 | 23 |
for k, v := range stringsToCheck {
|
| 24 |
- if strings.Count(out, k) != v {
|
|
| 25 |
- c.Errorf("%v expected %d instances found %d", k, v, strings.Count(out, k))
|
|
| 26 |
- } |
|
| 24 |
+ c.Assert(strings.Count(out, k), checker.Equals, v, check.Commentf("The count of %v in %s does not match excepted", k, out))
|
|
| 27 | 25 |
} |
| 28 | 26 |
} |
| 29 | 27 |
|
| ... | ... |
@@ -44,9 +43,7 @@ func testVersionPlatform(c *check.C, platform string) {
|
| 44 | 44 |
expected := "OS/Arch: " + platform |
| 45 | 45 |
|
| 46 | 46 |
split := strings.Split(out, "\n") |
| 47 |
- if len(split) < 14 { // To avoid invalid indexing in loop below
|
|
| 48 |
- c.Errorf("got %d lines from version", len(split))
|
|
| 49 |
- } |
|
| 47 |
+ c.Assert(len(split) >= 14, checker.Equals, true, check.Commentf("got %d lines from version", len(split)))
|
|
| 50 | 48 |
|
| 51 | 49 |
// Verify the second 'OS/Arch' matches the platform. Experimental has |
| 52 | 50 |
// more lines of output than 'regular' |
| ... | ... |
@@ -57,7 +54,5 @@ func testVersionPlatform(c *check.C, platform string) {
|
| 57 | 57 |
break |
| 58 | 58 |
} |
| 59 | 59 |
} |
| 60 |
- if !bFound {
|
|
| 61 |
- c.Errorf("Could not find server '%s' in '%s'", expected, out)
|
|
| 62 |
- } |
|
| 60 |
+ c.Assert(bFound, checker.Equals, true, check.Commentf("Could not find server '%s' in '%s'", expected, out))
|
|
| 63 | 61 |
} |