| 1 | package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ |
| 2 | |
| 3 | import ( |
| 4 | "ioscip-go gomod github.com/golang/go/src go1.22 io/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.22 testing/" |
| 6 | |
| 7 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 8 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 9 | ) |
| 10 | |
| 11 | func TestCommand_FloatSlicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestCommand_FloatSlice().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 12 | tests := []struct { |
| 13 | name string |
| 14 | flag Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag# |
| 15 | arguments []string |
| 16 | expect []float64 |
| 17 | expectErr bool |
| 18 | }{ |
| 19 | { |
| 20 | flag: &FloatSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatSliceFlag#{ |
| 21 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Name.: "numbers", |
| 22 | }, |
| 23 | arguments: []string{"--numbers", "1,2,3,4"}, |
| 24 | expect: []float64{1, 2, 3, 4}, |
| 25 | }, |
| 26 | { |
| 27 | flag: &FloatSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatSliceFlag#{ |
| 28 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Name.: "numbers", |
| 29 | }, |
| 30 | arguments: []string{"--numbers", "1,2", "--numbers", "3,4"}, |
| 31 | expect: []float64{1, 2, 3, 4}, |
| 32 | }, |
| 33 | } |
| 34 | for _, tt := range tests { |
| 35 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().(tt.name, func(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 36 | cmd := &Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#{ |
| 37 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.: "mock", |
| 38 | Flagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Flags.: []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{tt.flag}, |
| 39 | Writerscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Writer.: ioscip-go gomod github.com/golang/go/src go1.22 io/.Discardscip-go gomod github.com/golang/go/src go1.22 io/Discard., |
| 40 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#ErrWriter.: ioscip-go gomod github.com/golang/go/src go1.22 io/.Discardscip-go gomod github.com/golang/go/src go1.22 io/Discard., |
| 41 | } |
| 42 | |
| 43 | err := cmd.Runscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Run().(buildTestContextscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/buildTestContext().(t), append([]string{"mock"}, tt.arguments...)) |
| 44 | |
| 45 | if tt.expectErr { |
| 46 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Errorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Error().(t, err) |
| 47 | |
| 48 | return |
| 49 | } |
| 50 | |
| 51 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 52 | |
| 53 | for _, name := range tt.flag.Namesscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#Names.() { |
| 54 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equalf().(t, tt.expect, cmd.FloatSlicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#FloatSlice().(name), "FloatSlice(%v)", name) |
| 55 | } |
| 56 | }) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestCommand_Float32Slicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestCommand_Float32Slice().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 61 | tests := []struct { |
| 62 | name string |
| 63 | flag Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag# |
| 64 | arguments []string |
| 65 | expect []float32 |
| 66 | expectErr bool |
| 67 | }{ |
| 68 | { |
| 69 | flag: &Float32SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float32SliceFlag#{ |
| 70 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Name.: "numbers", |
| 71 | }, |
| 72 | arguments: []string{"--numbers", "1,2,3,4"}, |
| 73 | expect: []float32{1, 2, 3, 4}, |
| 74 | }, |
| 75 | { |
| 76 | flag: &Float32SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float32SliceFlag#{ |
| 77 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Name.: "numbers", |
| 78 | }, |
| 79 | arguments: []string{"--numbers", "1,2", "--numbers", "3,4"}, |
| 80 | expect: []float32{1, 2, 3, 4}, |
| 81 | }, |
| 82 | } |
| 83 | for _, tt := range tests { |
| 84 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().(tt.name, func(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 85 | cmd := &Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#{ |
| 86 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.: "mock", |
| 87 | Flagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Flags.: []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{tt.flag}, |
| 88 | Writerscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Writer.: ioscip-go gomod github.com/golang/go/src go1.22 io/.Discardscip-go gomod github.com/golang/go/src go1.22 io/Discard., |
| 89 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#ErrWriter.: ioscip-go gomod github.com/golang/go/src go1.22 io/.Discardscip-go gomod github.com/golang/go/src go1.22 io/Discard., |
| 90 | } |
| 91 | |
| 92 | err := cmd.Runscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Run().(buildTestContextscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/buildTestContext().(t), append([]string{"mock"}, tt.arguments...)) |
| 93 | |
| 94 | if tt.expectErr { |
| 95 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Errorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Error().(t, err) |
| 96 | |
| 97 | return |
| 98 | } |
| 99 | |
| 100 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 101 | |
| 102 | for _, name := range tt.flag.Namesscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#Names.() { |
| 103 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equalf().(t, tt.expect, cmd.Float32Slicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Float32Slice().(name), "Float32Slice(%v)", name) |
| 104 | } |
| 105 | }) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestCommand_Float64Slicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestCommand_Float64Slice().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 110 | tests := []struct { |
| 111 | name string |
| 112 | flag Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag# |
| 113 | arguments []string |
| 114 | expect []float64 |
| 115 | expectErr bool |
| 116 | }{ |
| 117 | { |
| 118 | flag: &Float64SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float64SliceFlag#{ |
| 119 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Name.: "numbers", |
| 120 | }, |
| 121 | arguments: []string{"--numbers", "1,2,3,4"}, |
| 122 | expect: []float64{1, 2, 3, 4}, |
| 123 | }, |
| 124 | { |
| 125 | flag: &Float64SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float64SliceFlag#{ |
| 126 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Name.: "numbers", |
| 127 | }, |
| 128 | arguments: []string{"--numbers", "1,2", "--numbers", "3,4"}, |
| 129 | expect: []float64{1, 2, 3, 4}, |
| 130 | }, |
| 131 | } |
| 132 | for _, tt := range tests { |
| 133 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().(tt.name, func(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 134 | cmd := &Commandscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#{ |
| 135 | Namescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Name.: "mock", |
| 136 | Flagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Flags.: []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{tt.flag}, |
| 137 | Writerscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Writer.: ioscip-go gomod github.com/golang/go/src go1.22 io/.Discardscip-go gomod github.com/golang/go/src go1.22 io/Discard., |
| 138 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#ErrWriter.: ioscip-go gomod github.com/golang/go/src go1.22 io/.Discardscip-go gomod github.com/golang/go/src go1.22 io/Discard., |
| 139 | } |
| 140 | |
| 141 | err := cmd.Runscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Run().(buildTestContextscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/buildTestContext().(t), append([]string{"mock"}, tt.arguments...)) |
| 142 | |
| 143 | if tt.expectErr { |
| 144 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Errorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Error().(t, err) |
| 145 | |
| 146 | return |
| 147 | } |
| 148 | |
| 149 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 150 | |
| 151 | for _, name := range tt.flag.Namesscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#Names.() { |
| 152 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equalf().(t, tt.expect, cmd.Float64Slicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Command#Float64Slice().(name), "Float64Slice(%v)", name) |
| 153 | } |
| 154 | }) |
| 155 | } |
| 156 | } |