1
0
mirror of https://github.com/moby/moby.git synced 2025-08-08 13:22:22 +03:00

integration: use %s for check.Commentf()

It is wrong to pass an arbitrary string to a function expecting
%-style formatting. One solution would be to replace any % with %%,
but it's easier to just do what this patch does.

Generated with:

for f in $(git grep -l 'check.Commentf(out)'); do \
	sed -i -e 's/check\.Commentf(out)/check.Commentf("%s", out)/g' $f; \
done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2018-08-14 10:45:39 +03:00
parent 1fd7e4c28d
commit 83363fb2d4
28 changed files with 285 additions and 285 deletions

View File

@@ -164,7 +164,7 @@ func (s *DockerSuite) TestExecTTYCloseStdin(c *check.C) {
stdinRw.Close()
out, _, err := runCommandWithOutput(cmd)
c.Assert(err, checker.IsNil, check.Commentf(out))
c.Assert(err, checker.IsNil, check.Commentf("%s", out))
out, _ = dockerCmd(c, "top", "exec_tty_stdin")
outArr := strings.Split(out, "\n")
@@ -517,7 +517,7 @@ func (s *DockerSuite) TestExecStartFails(c *check.C) {
c.Assert(waitRun(name), checker.IsNil)
out, _, err := dockerCmdWithError("exec", name, "no-such-cmd")
c.Assert(err, checker.NotNil, check.Commentf(out))
c.Assert(err, checker.NotNil, check.Commentf("%s", out))
c.Assert(out, checker.Contains, "executable file not found")
}