Browse code

rm-gocheck: Not(Matches) -> !cmp.Regexp

sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.Matches\), (.*)\)#assert.Assert(c, !is.Regexp("^"+\2+"$", \1)().Success())#g' \
-- "integration-cli/docker_cli_images_test.go"

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 10208e4d602164bea839d548deaa0bee085383a5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Tibor Vass authored on 2019/09/10 06:05:56
Showing 1 changed files
... ...
@@ -94,7 +94,7 @@ func (s *DockerSuite) TestImagesFilterLabelMatch(c *testing.T) {
94 94
 	out = strings.TrimSpace(out)
95 95
 	assert.Assert(c, out, checker.Matches, fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image1ID))
96 96
 	assert.Assert(c, out, checker.Matches, fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image2ID))
97
-	assert.Assert(c, out, checker.Not(checker.Matches), fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image3ID))
97
+	assert.Assert(c, !is.Regexp("^"+fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image3ID)+"$", out)().Success())
98 98
 
99 99
 	out, _ = dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match=me too")
100 100
 	out = strings.TrimSpace(out)