mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #8483 from duglin/TabTest
Add a testcase to make sure we don't squash tabs or convert them to spaces
This commit is contained in:
commit
005029cbdd
1 changed files with 19 additions and 0 deletions
|
@ -2907,3 +2907,22 @@ RUN echo 123`,
|
||||||
|
|
||||||
logDone("build - verbose output from commands")
|
logDone("build - verbose output from commands")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBuildWithTabs(t *testing.T) {
|
||||||
|
name := "testbuildwithtabs"
|
||||||
|
defer deleteImages(name)
|
||||||
|
_, err := buildImage(name,
|
||||||
|
"FROM busybox\nRUN echo\tone\t\ttwo", true)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
res, err := inspectFieldJSON(name, "ContainerConfig.Cmd")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
expected := "[\"/bin/sh\",\"-c\",\"echo\\u0009one\\u0009\\u0009two\"]"
|
||||||
|
if res != expected {
|
||||||
|
t.Fatalf("Missing tabs.\nGot:%s\nExp:%s", res, expected)
|
||||||
|
}
|
||||||
|
logDone("build - with tabs")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue