| 1 | package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ |
| 2 | |
| 3 | import ( |
| 4 | "flagscip-go gomod github.com/golang/go/src go1.22 flag/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.22 testing/" |
| 6 | "timescip-go gomod github.com/golang/go/src go1.22 time/" |
| 7 | |
| 8 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 9 | ) |
| 10 | |
| 11 | func TestFlag_SchemaType_Boolscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Bool().(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 | f := &BoolFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/BoolFlag#{} |
| 13 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 14 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 15 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "boolean", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 16 | _, ok = any(f).(SchemaItemsTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#) |
| 17 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 18 | } |
| 19 | |
| 20 | func TestFlag_SchemaType_Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_String().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 21 | f := &StringFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/StringFlag#{} |
| 22 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 23 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 24 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "string", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 25 | _, ok = any(f).(SchemaItemsTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#) |
| 26 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 27 | } |
| 28 | |
| 29 | func TestFlag_SchemaType_Intscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Int().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 30 | flags := []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{&IntFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/IntFlag#{}, &Int8Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int8Flag#{}, &Int16Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int16Flag#{}, &Int32Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int32Flag#{}, &Int64Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int64Flag#{}} |
| 31 | for _, f := range flags { |
| 32 | st, ok := f.(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 33 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 34 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "integer", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestFlag_SchemaType_Uintscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Uint().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 39 | flags := []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{&UintFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/UintFlag#{}, &Uint8Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint8Flag#{}, &Uint16Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint16Flag#{}, &Uint32Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint32Flag#{}, &Uint64Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint64Flag#{}} |
| 40 | for _, f := range flags { |
| 41 | st, ok := f.(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 42 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 43 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "integer", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestFlag_SchemaType_Floatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Float().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 48 | flags := []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{&FloatFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatFlag#{}, &Float32Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float32Flag#{}, &Float64Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float64Flag#{}} |
| 49 | for _, f := range flags { |
| 50 | st, ok := f.(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 51 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 52 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "number", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func TestFlag_SchemaType_Durationscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Duration().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 57 | f := &DurationFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/DurationFlag#{} |
| 58 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 59 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 60 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "duration", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 61 | } |
| 62 | |
| 63 | func TestFlag_SchemaType_Timestampscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Timestamp().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 64 | f := &TimestampFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TimestampFlag#{} |
| 65 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 66 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 67 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "date-time", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 68 | } |
| 69 | |
| 70 | func TestFlag_SchemaType_Slicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Slice().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 71 | flags := []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{ |
| 72 | &StringSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/StringSliceFlag#{}, |
| 73 | &IntSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/IntSliceFlag#{}, |
| 74 | &FloatSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatSliceFlag#{}, |
| 75 | } |
| 76 | for _, f := range flags { |
| 77 | st, ok := f.(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 78 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 79 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "array", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func TestFlag_SchemaItemsType_Slicescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaItemsType_Slice().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 84 | tests := []struct { |
| 85 | flag Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag# |
| 86 | itemType string |
| 87 | }{ |
| 88 | {&StringSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/StringSliceFlag#{}, "string"}, |
| 89 | {&IntSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/IntSliceFlag#{}, "integer"}, |
| 90 | {&Int8SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int8SliceFlag#{}, "integer"}, |
| 91 | {&Int16SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int16SliceFlag#{}, "integer"}, |
| 92 | {&Int32SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int32SliceFlag#{}, "integer"}, |
| 93 | {&Int64SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Int64SliceFlag#{}, "integer"}, |
| 94 | {&UintSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/UintSliceFlag#{}, "integer"}, |
| 95 | {&Uint8SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint8SliceFlag#{}, "integer"}, |
| 96 | {&Uint16SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint16SliceFlag#{}, "integer"}, |
| 97 | {&Uint32SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint32SliceFlag#{}, "integer"}, |
| 98 | {&Uint64SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Uint64SliceFlag#{}, "integer"}, |
| 99 | {&FloatSliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatSliceFlag#{}, "number"}, |
| 100 | {&Float32SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float32SliceFlag#{}, "number"}, |
| 101 | {&Float64SliceFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Float64SliceFlag#{}, "number"}, |
| 102 | } |
| 103 | for _, tc := range tests { |
| 104 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("", 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#) { |
| 105 | st, ok := tc.flag.(SchemaItemsTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#) |
| 106 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 107 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, tc.itemType, st.SchemaItemsTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#SchemaItemsType.()) |
| 108 | }) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func TestFlag_SchemaType_Mapscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Map().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 113 | f := &StringMapFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/StringMapFlag#{} |
| 114 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 115 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 116 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "object", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 117 | sit, ok := any(f).(SchemaItemsTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#) |
| 118 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 119 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "", sit.SchemaItemsTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#SchemaItemsType.()) |
| 120 | } |
| 121 | |
| 122 | func TestFlag_SchemaType_Genericscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_Generic().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 123 | f := &GenericFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/GenericFlag#{} |
| 124 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 125 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 126 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 127 | } |
| 128 | |
| 129 | func TestExtFlag_SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestExtFlag_SchemaType().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 130 | tests := []struct { |
| 131 | name string |
| 132 | makeFlag func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# |
| 133 | schemaType string |
| 134 | }{ |
| 135 | { |
| 136 | name: "bool", |
| 137 | makeFlag: func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# { |
| 138 | var bv boolValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/boolValue# |
| 139 | var p bool |
| 140 | return &extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#{fscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#f.: &flagscip-go gomod github.com/golang/go/src go1.22 flag/.Flagscip-go gomod github.com/golang/go/src go1.22 flag/Flag#{Valuescip-go gomod github.com/golang/go/src go1.22 flag/Flag#Value.: bv.Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/boolValue#Create().(true, &p, BoolConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/BoolConfig#{})}} |
| 141 | }, |
| 142 | schemaType: "boolean", |
| 143 | }, |
| 144 | { |
| 145 | name: "string", |
| 146 | makeFlag: func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# { |
| 147 | var sv stringValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/stringValue# |
| 148 | var p string |
| 149 | return &extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#{fscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#f.: &flagscip-go gomod github.com/golang/go/src go1.22 flag/.Flagscip-go gomod github.com/golang/go/src go1.22 flag/Flag#{Valuescip-go gomod github.com/golang/go/src go1.22 flag/Flag#Value.: sv.Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/stringValue#Create().("hi", &p, StringConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/StringConfig#{})}} |
| 150 | }, |
| 151 | schemaType: "string", |
| 152 | }, |
| 153 | { |
| 154 | name: "float64", |
| 155 | makeFlag: func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# { |
| 156 | var fv floatValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#[float64] |
| 157 | var p float64 |
| 158 | return &extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#{fscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#f.: &flagscip-go gomod github.com/golang/go/src go1.22 flag/.Flagscip-go gomod github.com/golang/go/src go1.22 flag/Flag#{Valuescip-go gomod github.com/golang/go/src go1.22 flag/Flag#Value.: fv.Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/floatValue#Create().(3.14, &p, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#{})}} |
| 159 | }, |
| 160 | schemaType: "number", |
| 161 | }, |
| 162 | { |
| 163 | name: "duration", |
| 164 | makeFlag: func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# { |
| 165 | var dv durationValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue# |
| 166 | var p timescip-go gomod github.com/golang/go/src go1.22 time/.Durationscip-go gomod github.com/golang/go/src go1.22 time/Duration# |
| 167 | return &extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#{fscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#f.: &flagscip-go gomod github.com/golang/go/src go1.22 flag/.Flagscip-go gomod github.com/golang/go/src go1.22 flag/Flag#{Valuescip-go gomod github.com/golang/go/src go1.22 flag/Flag#Value.: dv.Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/durationValue#Create().(5*timescip-go gomod github.com/golang/go/src go1.22 time/.Secondscip-go gomod github.com/golang/go/src go1.22 time/Second., &p, NoConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NoConfig#{})}} |
| 168 | }, |
| 169 | schemaType: "duration", |
| 170 | }, |
| 171 | { |
| 172 | name: "timestamp", |
| 173 | makeFlag: func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# { |
| 174 | var tv timestampValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/timestampValue# |
| 175 | var p timescip-go gomod github.com/golang/go/src go1.22 time/.Timescip-go gomod github.com/golang/go/src go1.22 time/Time# |
| 176 | return &extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#{fscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#f.: &flagscip-go gomod github.com/golang/go/src go1.22 flag/.Flagscip-go gomod github.com/golang/go/src go1.22 flag/Flag#{Valuescip-go gomod github.com/golang/go/src go1.22 flag/Flag#Value.: tv.Createscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/timestampValue#Create().(timescip-go gomod github.com/golang/go/src go1.22 time/.Datescip-go gomod github.com/golang/go/src go1.22 time/Date().(2024, 1, 1, 0, 0, 0, 0, timescip-go gomod github.com/golang/go/src go1.22 time/.UTCscip-go gomod github.com/golang/go/src go1.22 time/UTC.), &p, TimestampConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TimestampConfig#{})}} |
| 177 | }, |
| 178 | schemaType: "date-time", |
| 179 | }, |
| 180 | { |
| 181 | name: "unknown", |
| 182 | makeFlag: func() *extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag# { |
| 183 | return &extFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#{fscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#f.: &flagscip-go gomod github.com/golang/go/src go1.22 flag/.Flagscip-go gomod github.com/golang/go/src go1.22 flag/Flag#{Valuescip-go gomod github.com/golang/go/src go1.22 flag/Flag#Value.: &customValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#{}}} |
| 184 | }, |
| 185 | schemaType: "", |
| 186 | }, |
| 187 | } |
| 188 | for _, tc := range tests { |
| 189 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().(tc.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#) { |
| 190 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, tc.schemaType, tc.makeFlag().SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#SchemaType().()) |
| 191 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "", tc.makeFlag().SchemaItemsTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/extFlag#SchemaItemsType().()) |
| 192 | }) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | type customValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue# struct{} |
| 197 | |
| 198 | func (c *customValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#) Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#String().() string { return "custom" } |
| 199 | func (c *customValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#) Setscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#Set().(string) error { return nil } |
| 200 | func (c *customValuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#) Getscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/customValue#Get().() any { return struct{}{} } |
| 201 | |
| 202 | func TestFlag_SchemaType_BoolWithInversescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_BoolWithInverse().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 203 | f := &BoolWithInverseFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/BoolWithInverseFlag#{} |
| 204 | st, ok := any(f).(SchemaTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#) |
| 205 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 206 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "boolean", st.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaTyper#SchemaType.()) |
| 207 | sit, ok := any(f).(SchemaItemsTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#) |
| 208 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 209 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "", sit.SchemaItemsTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#SchemaItemsType.()) |
| 210 | } |
| 211 | |
| 212 | func TestFlag_SchemaType_NonSliceItemsTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_NonSliceItemsType().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 213 | flags := []Flagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Flag#{ |
| 214 | &BoolFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/BoolFlag#{}, |
| 215 | &StringFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/StringFlag#{}, |
| 216 | &IntFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/IntFlag#{}, |
| 217 | &FloatFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FloatFlag#{}, |
| 218 | &DurationFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/DurationFlag#{}, |
| 219 | &TimestampFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TimestampFlag#{}, |
| 220 | } |
| 221 | for _, f := range flags { |
| 222 | sit, ok := f.(SchemaItemsTyperscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#) |
| 223 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 224 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "", sit.SchemaItemsTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/SchemaItemsTyper#SchemaItemsType.()) |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | func TestFlag_SchemaType_PreservesPrecisionscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFlag_SchemaType_PreservesPrecision().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 229 | created := timescip-go gomod github.com/golang/go/src go1.22 time/.Datescip-go gomod github.com/golang/go/src go1.22 time/Date().(2024, 1, 1, 0, 0, 0, 0, timescip-go gomod github.com/golang/go/src go1.22 time/.UTCscip-go gomod github.com/golang/go/src go1.22 time/UTC.) |
| 230 | f := &TimestampFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TimestampFlag#{Configscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Config.: TimestampConfigscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TimestampConfig#{Layoutsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TimestampConfig#Layouts.: []string{timescip-go gomod github.com/golang/go/src go1.22 time/.RFC3339scip-go gomod github.com/golang/go/src go1.22 time/RFC3339.}}, Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Value.: created} |
| 231 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "date-time", f.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#SchemaType().()) |
| 232 | |
| 233 | f2 := &DurationFlagscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/DurationFlag#{Valuescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#Value.: 5 * timescip-go gomod github.com/golang/go/src go1.22 time/.Secondscip-go gomod github.com/golang/go/src go1.22 time/Second.} |
| 234 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "duration", f2.SchemaTypescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/FlagBase#SchemaType().()) |
| 235 | } |