// TestImageFiles checks that the root command will collect the positional
// arguments as image filepaths.
TestImageFiles checks that the root command will collect the positional
arguments as image filepaths.
// TestImageFiles checks that the root command will collect the positional // arguments as image filepaths .
func TestImageFiles(t *testing.T) {
	args := []string{"path/to/image1.ext", "path/to/image2.example"}
	mainFunc = func([]string, map[string]struct{}) {}
	defer func() {
		mainFunc = internal.Root
	}()
	outErr := new(bytes.Buffer)
	RootCmd.SetErr(outErr)
	RootCmd.SetArgs(args)
	if _, err := RootCmd.ExecuteC(); err != nil {
		t.Fatalf(`err %v, want nil`, err)
	}
	for i, v := range args {
		if actual := ImageFiles[i]; actual != v {
			t.Errorf(`ImageFiles[%d] = %v, want %v`, i, actual, v)
		}
	}
}
func TestImageFiles ( t * testing . T ) { args := [ ] string { " " , " " } mainFunc = func ( [ ] string , map [ string ] struct { } ) { } defer func ( ) { mainFunc = internal . Root } ( ) outErr := new ( bytes . Buffer ) RootCmd . SetErr ( outErr ) RootCmd . SetArgs ( args ) if _ , err := RootCmd . ExecuteC ( ) ; err != nil { t . Fatalf ( `err %v, want nil` , err ) } for i , v := range args { if actual := ImageFiles [ i ] ; actual != v { t . Errorf ( `ImageFiles[%d] = %v, want %v` , i , actual , v ) } } }
TestImageFiles checks that the root command will collect the positional
arguments as image filepaths.
TestImageFiles checks that the root command will collect the positional arguments as image filepaths .