Add TAP header

This commit is contained in:
Yann Hamon 2020-12-15 22:09:07 +01:00
parent 07dec90112
commit 69e2fc8ba9
2 changed files with 7 additions and 2 deletions

View file

@ -32,6 +32,11 @@ func tapOutput(w io.Writer, withSummary bool, isStdin, verbose bool) Output {
// JSON.Write will only write when JSON.Flush has been called
func (o *tapo) Write(res validator.Result) error {
o.index++
if o.index == 1 {
fmt.Fprintf(o.w, "TAP version 13\n")
}
switch res.Status {
case validator.Valid:
sig, _ := res.Resource.Signature()

View file

@ -36,7 +36,7 @@ metadata:
Err: nil,
},
},
"ok 1 - deployment.yml (Deployment)\n1..1\n",
"TAP version 13\nok 1 - deployment.yml (Deployment)\n1..1\n",
},
{
"a single deployment, verbose, with summary",
@ -57,7 +57,7 @@ metadata:
Err: nil,
},
},
"ok 1 - deployment.yml (Deployment)\n1..1\n",
"TAP version 13\nok 1 - deployment.yml (Deployment)\n1..1\n",
},
} {
w := new(bytes.Buffer)