Forráskód Böngészése

Fix a bad assumption

If the empty variable happens to be sorted to the end of the list then TrimSpace()
would remove it. Instead only strip the single trailing newline.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Daniel Nephin 7 éve
szülő
commit
fff605c3b3
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      integration-cli/docker_cli_run_test.go

+ 1 - 1
integration-cli/docker_cli_run_test.go

@@ -824,7 +824,7 @@ func (s *DockerSuite) TestRunEnvironment(c *check.C) {
 	})
 	result.Assert(c, icmd.Success)
 
-	actualEnv := strings.Split(strings.TrimSpace(result.Combined()), "\n")
+	actualEnv := strings.Split(strings.TrimSuffix(result.Stdout(), "\n"), "\n")
 	sort.Strings(actualEnv)
 
 	goodEnv := []string{