mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
Restore "table" --format from V1
* --format "table {{.field..." will print fields out in a table with headings. Table keyword is removed, spaces between fields are converted to tabs * Update parse.MatchesJSONFormat()'s regex to be more inclusive * Add report.Headers(), obtain all the field names to be used as column headers, a map of field name to column headers may be provided to override the field names * Update several commands to use new functions Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@ -50,15 +50,17 @@ var _ = Describe("Podman Info", func() {
|
||||
{"{{ json .}}", true, 0},
|
||||
{"{{json . }}", true, 0},
|
||||
{" {{ json . }} ", true, 0},
|
||||
{"{{json }}", false, 125},
|
||||
{"{{json }}", true, 0},
|
||||
{"{{json .", false, 125},
|
||||
{"json . }}", false, 0}, // Note: this does NOT fail but produces garbage
|
||||
{"json . }}", false, 0}, // without opening {{ template seen as string literal
|
||||
}
|
||||
for _, tt := range tests {
|
||||
session := podmanTest.Podman([]string{"info", "--format", tt.input})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(tt.exitCode))
|
||||
Expect(session.IsJSONOutputValid()).To(Equal(tt.success))
|
||||
|
||||
desc := fmt.Sprintf("JSON test(%q)", tt.input)
|
||||
Expect(session).Should(Exit(tt.exitCode), desc)
|
||||
Expect(session.IsJSONOutputValid()).To(Equal(tt.success), desc)
|
||||
}
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user