mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace` Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
a73b7354a6
commit
475c65319b
31 changed files with 130 additions and 129 deletions
|
|
@ -30,11 +30,11 @@ func TestCpGarbagePath(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -92,11 +92,11 @@ func TestCpRelativePath(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -162,11 +162,11 @@ func TestCpAbsolutePath(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -226,11 +226,11 @@ func TestCpAbsoluteSymlink(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -290,11 +290,11 @@ func TestCpSymlinkComponent(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -355,11 +355,11 @@ func TestCpUnprivilegedUser(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -398,11 +398,11 @@ func TestCpSpecialFiles(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -471,11 +471,11 @@ func TestCpVolumePath(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -562,11 +562,11 @@ func TestCpToDot(t *testing.T) {
|
|||
t.Fatal("failed to create a container", out, err)
|
||||
}
|
||||
|
||||
cleanedContainerID := stripTrailingCharacters(out)
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cleanedContainerID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cleanedContainerID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatal("failed to set up container", out, err)
|
||||
}
|
||||
|
||||
|
|
@ -600,11 +600,11 @@ func TestCpToStdout(t *testing.T) {
|
|||
t.Fatalf("failed to create a container:%s\n%s", out, err)
|
||||
}
|
||||
|
||||
cID := stripTrailingCharacters(out)
|
||||
cID := strings.TrimSpace(out)
|
||||
defer deleteContainer(cID)
|
||||
|
||||
out, _, err = dockerCmd(t, "wait", cID)
|
||||
if err != nil || stripTrailingCharacters(out) != "0" {
|
||||
if err != nil || strings.TrimSpace(out) != "0" {
|
||||
t.Fatalf("failed to set up container:%s\n%s", out, err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue