From d4d0718ebfc63e5d224ff9d667fe06088eb19563 Mon Sep 17 00:00:00 2001 From: Mageee <21521230.zju.edu.cn> Date: Fri, 9 Oct 2015 11:10:09 +0800 Subject: [PATCH] update docker_cli_version_test.go fix spelling mistake again Signed-off-by: Mageee --- integration-cli/docker_cli_version_test.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/integration-cli/docker_cli_version_test.go b/integration-cli/docker_cli_version_test.go index 1d8fe120b6..48b52f3187 100644 --- a/integration-cli/docker_cli_version_test.go +++ b/integration-cli/docker_cli_version_test.go @@ -3,6 +3,7 @@ package main import ( "strings" + "github.com/docker/docker/pkg/integration/checker" "github.com/go-check/check" ) @@ -21,9 +22,7 @@ func (s *DockerSuite) TestVersionEnsureSucceeds(c *check.C) { } for k, v := range stringsToCheck { - if strings.Count(out, k) != v { - c.Errorf("%v expected %d instances found %d", k, v, strings.Count(out, k)) - } + c.Assert(strings.Count(out, k), checker.Equals, v, check.Commentf("The count of %v in %s does not match excepted", k, out)) } } @@ -44,9 +43,7 @@ func testVersionPlatform(c *check.C, platform string) { expected := "OS/Arch: " + platform split := strings.Split(out, "\n") - if len(split) < 14 { // To avoid invalid indexing in loop below - c.Errorf("got %d lines from version", len(split)) - } + c.Assert(len(split) >= 14, checker.Equals, true, check.Commentf("got %d lines from version", len(split))) // Verify the second 'OS/Arch' matches the platform. Experimental has // more lines of output than 'regular' @@ -57,7 +54,5 @@ func testVersionPlatform(c *check.C, platform string) { break } } - if !bFound { - c.Errorf("Could not find server '%s' in '%s'", expected, out) - } + c.Assert(bFound, checker.Equals, true, check.Commentf("Could not find server '%s' in '%s'", expected, out)) }