builder/parser: fix handling of empty strings as the only argument.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
parent
234f0e4f79
commit
6b322ad2d3
|
@ -81,8 +81,10 @@ func parseLine(line string) (string, *Node, error) {
|
||||||
return "", nil, err
|
return "", nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sexp.Value != "" || sexp.Next != nil || sexp.Children != nil {
|
||||||
node.Next = sexp
|
node.Next = sexp
|
||||||
node.Attributes = attrs
|
node.Attributes = attrs
|
||||||
|
}
|
||||||
|
|
||||||
return "", node, nil
|
return "", node, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package parser
|
package parser
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -69,7 +70,9 @@ func TestTestData(t *testing.T) {
|
||||||
t.Fatalf("Error reading %s's result file: %s", dir.Name(), err.Error())
|
t.Fatalf("Error reading %s's result file: %s", dir.Name(), err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if ast.Dump() != string(content) {
|
if ast.Dump()+"\n" != string(content) {
|
||||||
|
fmt.Fprintln(os.Stderr, ast.Dump())
|
||||||
|
fmt.Fprintln(os.Stderr, string(content))
|
||||||
t.Fatalf("%s: AST dump of dockerfile does not match result", dir.Name())
|
t.Fatalf("%s: AST dump of dockerfile does not match result", dir.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
(from "brimstone/ubuntu:14.04")
|
(from "brimstone/ubuntu:14.04")
|
||||||
(cmd "")
|
(cmd)
|
||||||
(entrypoint "/usr/bin/consul" "agent" "-server" "-data-dir=/consul" "-client=0.0.0.0" "-ui-dir=/webui")
|
(entrypoint "/usr/bin/consul" "agent" "-server" "-data-dir=/consul" "-client=0.0.0.0" "-ui-dir=/webui")
|
||||||
(expose "8500" "8600" "8400" "8301" "8302")
|
(expose "8500" "8600" "8400" "8301" "8302")
|
||||||
(run "apt-get update && apt-get install -y unzip wget && apt-get clean && rm -rf /var/lib/apt/lists")
|
(run "apt-get update && apt-get install -y unzip wget && apt-get clean && rm -rf /var/lib/apt/lists")
|
||||||
|
|
Loading…
Reference in New Issue