Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b59378077 |
@@ -1860,20 +1860,24 @@ func TestCommandsReadHelpAsArgument(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestCheckHelpBesideArgument runs check with --help or -h before and after
|
// TestHelpBesideArgument runs each command that takes a path or URL with
|
||||||
// a directory, and runs help check. Each must print what check --help prints.
|
// --help or -h before and after a directory, and runs help on that command.
|
||||||
func TestCheckHelpBesideArgument(t *testing.T) {
|
// Each must print what the command's own --help prints.
|
||||||
|
func TestHelpBesideArgument(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
want := testOpts([]string{testApp, cmdCheck, testFlagHelp}, afero.NewMemMapFs())
|
for _, command := range []string{
|
||||||
|
cmdGenerate, cmdCheck, cmdFreshen, cmdList, cmdExport, cmdFetch,
|
||||||
|
} {
|
||||||
|
want := testOpts([]string{testApp, command, testFlagHelp}, afero.NewMemMapFs())
|
||||||
require.Equal(t, 0, runCLI(want))
|
require.Equal(t, 0, runCLI(want))
|
||||||
require.Contains(t, testStdout(t, want), "Validate files using manifest file")
|
require.Contains(t, testStdout(t, want), testApp+" "+command)
|
||||||
|
|
||||||
for _, args := range [][]string{
|
for _, args := range [][]string{
|
||||||
{cmdCheck, testDir, testFlagHelp},
|
{command, testDir, testFlagHelp},
|
||||||
{cmdCheck, testFlagHelp, testDir},
|
{command, testFlagHelp, testDir},
|
||||||
{cmdCheck, testDir, "-h"},
|
{command, testDir, "-h"},
|
||||||
{testCmdHelp, cmdCheck},
|
{testCmdHelp, command},
|
||||||
} {
|
} {
|
||||||
t.Run(strings.Join(args, " "), func(t *testing.T) {
|
t.Run(strings.Join(args, " "), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
@@ -1883,6 +1887,7 @@ func TestCheckHelpBesideArgument(t *testing.T) {
|
|||||||
assert.Equal(t, testStdout(t, want), testStdout(t, opts))
|
assert.Equal(t, testStdout(t, want), testStdout(t, opts))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCheckDetectsManifestCorruption(t *testing.T) {
|
func TestCheckDetectsManifestCorruption(t *testing.T) {
|
||||||
|
|||||||
Reference in new issue
Block a user