| 1 | package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.22 fmt/" |
| 5 | "math/randscip-go gomod github.com/golang/go/src go1.22 `math/rand`/" |
| 6 | "osscip-go gomod github.com/golang/go/src go1.22 os/" |
| 7 | "path/filepathscip-go gomod github.com/golang/go/src go1.22 `path/filepath`/" |
| 8 | "testingscip-go gomod github.com/golang/go/src go1.22 testing/" |
| 9 | |
| 10 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 11 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 12 | ) |
| 13 | |
| 14 | func TestZeroValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestZeroValueSourceChain().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 15 | var vc ValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain# |
| 16 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Empty().(t, vc.EnvKeysscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#EnvKeys().()) |
| 17 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotEmptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotEmpty().(t, vc.GoStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#GoString().()) |
| 18 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Empty().(t, vc.Chainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#Chain.) |
| 19 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Empty().(t, vc.Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#String().()) |
| 20 | } |
| 21 | |
| 22 | func TestEnvVarValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestEnvVarValueSource().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 23 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements ValueSource", 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#) { |
| 24 | src := EnvVarscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVar().("foo") |
| 25 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Implements().(t, (*ValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#)(nil), src) |
| 26 | |
| 27 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("not found", 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#) { |
| 28 | t.Setenvscip-go gomod github.com/golang/go/src go1.22 testing/T#Setenv().("foo", "bar") |
| 29 | |
| 30 | src := EnvVarscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVar().("foo_1") |
| 31 | _, ok := src.Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#Lookup.() |
| 32 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/False().(t, ok) |
| 33 | }) |
| 34 | |
| 35 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("found", 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 | t.Setenvscip-go gomod github.com/golang/go/src go1.22 testing/T#Setenv().("foo", "bar") |
| 37 | |
| 38 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 39 | src := EnvVarscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVar().("foo") |
| 40 | |
| 41 | str, ok := src.Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#Lookup.() |
| 42 | r.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#True().(ok) |
| 43 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().(str, "bar") |
| 44 | }) |
| 45 | }) |
| 46 | |
| 47 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements fmt.Stringer", 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#) { |
| 48 | src := EnvVarscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVar().("foo") |
| 49 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 50 | |
| 51 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Stringerscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#)(nil), src) |
| 52 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("environment variable \"foo\"", src.Stringscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#String().()) |
| 53 | }) |
| 54 | |
| 55 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements fmt.GoStringer", 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#) { |
| 56 | src := EnvVarscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVar().("foo") |
| 57 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 58 | |
| 59 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.GoStringerscip-go gomod github.com/golang/go/src go1.22 fmt/GoStringer#)(nil), src) |
| 60 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("&envVarValueSource{Key:\"foo\"}", src.GoStringscip-go gomod github.com/golang/go/src go1.22 fmt/GoStringer#GoString().()) |
| 61 | }) |
| 62 | } |
| 63 | |
| 64 | func TestEnvVarsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestEnvVars().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 65 | t.Setenvscip-go gomod github.com/golang/go/src go1.22 testing/T#Setenv().("myfoo", "mybar") |
| 66 | |
| 67 | source := EnvVarsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVars().("foo1", "myfoo") |
| 68 | str, src, ok := source.LookupWithSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#LookupWithSource().() |
| 69 | |
| 70 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 71 | r.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#True().(ok) |
| 72 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().(str, "mybar") |
| 73 | r.Containsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Contains().(src.Stringscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#String().(), "\"myfoo\"") |
| 74 | } |
| 75 | |
| 76 | func TestFileValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFileValueSource().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 77 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements ValueSource", 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#) { |
| 78 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 79 | |
| 80 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*ValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#)(nil), &fileValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fileValueSource#{}) |
| 81 | |
| 82 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("not found", 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#) { |
| 83 | src := Filescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/File().(fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("junk_file_name-%[1]v", randscip-go gomod github.com/golang/go/src go1.22 `math/rand`/.Intscip-go gomod github.com/golang/go/src go1.22 `math/rand`/Int().())) |
| 84 | _, ok := src.Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#Lookup.() |
| 85 | r.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#False().(ok) |
| 86 | }) |
| 87 | |
| 88 | fileName := filepathscip-go gomod github.com/golang/go/src go1.22 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.22 `path/filepath`/Join().(osscip-go gomod github.com/golang/go/src go1.22 os/.TempDirscip-go gomod github.com/golang/go/src go1.22 os/TempDir().(), fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("urfave-cli-testing-existing_file-%[1]v", randscip-go gomod github.com/golang/go/src go1.22 `math/rand`/.Intscip-go gomod github.com/golang/go/src go1.22 `math/rand`/Int().())) |
| 89 | t.Cleanupscip-go gomod github.com/golang/go/src go1.22 testing/common#Cleanup().(func() { _ = osscip-go gomod github.com/golang/go/src go1.22 os/.Removescip-go gomod github.com/golang/go/src go1.22 os/Remove().(fileName) }) |
| 90 | |
| 91 | r.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Nil().(osscip-go gomod github.com/golang/go/src go1.22 os/.WriteFilescip-go gomod github.com/golang/go/src go1.22 os/WriteFile().(fileName, []byte("pita"), 0o644)) |
| 92 | |
| 93 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("found", 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#) { |
| 94 | src := Filescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/File().(fileName) |
| 95 | str, ok := src.Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#Lookup.() |
| 96 | r.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#True().(ok) |
| 97 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("pita", str) |
| 98 | }) |
| 99 | }) |
| 100 | |
| 101 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements fmt.Stringer", 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#) { |
| 102 | src := Filescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/File().("/dev/null") |
| 103 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 104 | |
| 105 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*ValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#)(nil), src) |
| 106 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("file \"/dev/null\"", src.Stringscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#String().()) |
| 107 | }) |
| 108 | |
| 109 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements fmt.GoStringer", 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#) { |
| 110 | src := Filescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/File().("/dev/null") |
| 111 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 112 | |
| 113 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*ValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#)(nil), src) |
| 114 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("&fileValueSource{Path:\"/dev/null\"}", src.GoStringscip-go gomod github.com/golang/go/src go1.22 fmt/GoStringer#GoString().()) |
| 115 | }) |
| 116 | } |
| 117 | |
| 118 | func TestFilePathsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestFilePaths().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 119 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 120 | |
| 121 | fileName := filepathscip-go gomod github.com/golang/go/src go1.22 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.22 `path/filepath`/Join().(osscip-go gomod github.com/golang/go/src go1.22 os/.TempDirscip-go gomod github.com/golang/go/src go1.22 os/TempDir().(), fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("urfave-cli-tests-some_file_name_%[1]v", randscip-go gomod github.com/golang/go/src go1.22 `math/rand`/.Intscip-go gomod github.com/golang/go/src go1.22 `math/rand`/Int().())) |
| 122 | t.Cleanupscip-go gomod github.com/golang/go/src go1.22 testing/common#Cleanup().(func() { _ = osscip-go gomod github.com/golang/go/src go1.22 os/.Removescip-go gomod github.com/golang/go/src go1.22 os/Remove().(fileName) }) |
| 123 | |
| 124 | r.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Nil().(osscip-go gomod github.com/golang/go/src go1.22 os/.WriteFilescip-go gomod github.com/golang/go/src go1.22 os/WriteFile().(fileName, []byte("Hello"), 0o644)) |
| 125 | |
| 126 | sources := Filesscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Files().("junk_file_name", fileName) |
| 127 | str, src, ok := sources.LookupWithSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#LookupWithSource().() |
| 128 | r.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#True().(ok) |
| 129 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().(str, "Hello") |
| 130 | r.Containsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Contains().(src.Stringscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#String().(), fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("%[1]q", fileName)) |
| 131 | } |
| 132 | |
| 133 | func TestValueSourceChainEnvKeysscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestValueSourceChainEnvKeys().(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 | chain := NewValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewValueSourceChain().( |
| 135 | &staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#{"hello"}, |
| 136 | ) |
| 137 | chain.Appendscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#Append().(EnvVarsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/EnvVars().("foo", "bar")) |
| 138 | |
| 139 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 140 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().([]string{"foo", "bar"}, chain.EnvKeysscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#EnvKeys().()) |
| 141 | } |
| 142 | |
| 143 | func TestValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestValueSourceChain().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 144 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements ValueSource", 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#) { |
| 145 | vsc := &ValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#{} |
| 146 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 147 | |
| 148 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*ValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#)(nil), vsc) |
| 149 | |
| 150 | _, ok := vsc.Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#Lookup().() |
| 151 | r.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#False().(ok) |
| 152 | }) |
| 153 | |
| 154 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements fmt.GoStringer", 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#) { |
| 155 | vsc := &ValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#{} |
| 156 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 157 | |
| 158 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.GoStringerscip-go gomod github.com/golang/go/src go1.22 fmt/GoStringer#)(nil), vsc) |
| 159 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("&ValueSourceChain{Chain:{}}", vsc.GoStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#GoString().()) |
| 160 | |
| 161 | vsc1 := NewValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewValueSourceChain().(&staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#{vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v.: "yahtzee"}, |
| 162 | &staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#{vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v.: "matzoh"}, |
| 163 | ) |
| 164 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("&ValueSourceChain{Chain:{&staticValueSource{v:\"yahtzee\"},&staticValueSource{v:\"matzoh\"}}}", vsc1.GoStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#GoString().()) |
| 165 | }) |
| 166 | |
| 167 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().("implements fmt.Stringer", 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#) { |
| 168 | vsc := &ValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#{} |
| 169 | r := requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Newscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/New().(t) |
| 170 | |
| 171 | r.Implementsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Implements().((*fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Stringerscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#)(nil), vsc) |
| 172 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("", vsc.Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#String().()) |
| 173 | |
| 174 | vsc1 := NewValueSourceChainscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewValueSourceChain().( |
| 175 | &staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#{vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v.: "soup"}, |
| 176 | &staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#{vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v.: "salad"}, |
| 177 | &staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#{vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v.: "pumpkins"}, |
| 178 | ) |
| 179 | r.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Assertions#Equal().("soup,salad,pumpkins", vsc1.Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSourceChain#String().()) |
| 180 | }) |
| 181 | } |
| 182 | |
| 183 | type staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource# struct { |
| 184 | vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v. string |
| 185 | } |
| 186 | |
| 187 | func (svs *staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#) GoStringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#GoString().() string { |
| 188 | return fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("&staticValueSource{v:%[1]q}", svs.vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v.) |
| 189 | } |
| 190 | func (svs *staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#) Stringscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#String().() string { return svs.vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v. } |
| 191 | func (svs *staticValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#) Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#Lookup().() (string, bool) { return svs.vscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/staticValueSource#v., true } |
| 192 | |
| 193 | func TestMapValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestMapValueSource().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 194 | tests := []struct { |
| 195 | name string |
| 196 | m map[any]any |
| 197 | key string |
| 198 | val string |
| 199 | found bool |
| 200 | }{ |
| 201 | { |
| 202 | name: "No map no key", |
| 203 | }, |
| 204 | { |
| 205 | name: "No map with key", |
| 206 | key: "foo", |
| 207 | }, |
| 208 | { |
| 209 | name: "Empty map no key", |
| 210 | m: map[any]any{}, |
| 211 | }, |
| 212 | { |
| 213 | name: "Empty map with key", |
| 214 | key: "foo", |
| 215 | m: map[any]any{}, |
| 216 | }, |
| 217 | { |
| 218 | name: "Level 1 no key", |
| 219 | key: ".foob", |
| 220 | m: map[any]any{ |
| 221 | "foo": 10, |
| 222 | }, |
| 223 | }, |
| 224 | { |
| 225 | name: "Level 1", |
| 226 | key: "foobar", |
| 227 | m: map[any]any{ |
| 228 | "foobar": 10, |
| 229 | }, |
| 230 | val: "10", |
| 231 | found: true, |
| 232 | }, |
| 233 | { |
| 234 | name: "Level 2", |
| 235 | key: "foo.bar", |
| 236 | m: map[any]any{ |
| 237 | "foo": map[any]any{ |
| 238 | "bar": 10, |
| 239 | }, |
| 240 | }, |
| 241 | val: "10", |
| 242 | found: true, |
| 243 | }, |
| 244 | { |
| 245 | name: "Level 2 invalid key", |
| 246 | key: "foo.bar1", |
| 247 | m: map[any]any{ |
| 248 | "foo": map[any]any{ |
| 249 | "bar": "10", |
| 250 | }, |
| 251 | }, |
| 252 | }, |
| 253 | { |
| 254 | name: "Level 2 string map type", |
| 255 | key: "foo.bar1", |
| 256 | m: map[any]any{ |
| 257 | "foo": map[string]any{ |
| 258 | "bar": "10", |
| 259 | }, |
| 260 | }, |
| 261 | }, |
| 262 | { |
| 263 | name: "Level 3 no entry", |
| 264 | key: "foo.bar.t", |
| 265 | m: map[any]any{ |
| 266 | "foo": map[any]any{ |
| 267 | "bar": "sss", |
| 268 | }, |
| 269 | }, |
| 270 | }, |
| 271 | { |
| 272 | name: "Level 3", |
| 273 | key: "foo.bar.t", |
| 274 | m: map[any]any{ |
| 275 | "foo": map[any]any{ |
| 276 | "bar": map[any]any{ |
| 277 | "t": "sss", |
| 278 | }, |
| 279 | }, |
| 280 | }, |
| 281 | val: "sss", |
| 282 | found: true, |
| 283 | }, |
| 284 | { |
| 285 | name: "Level 3 invalid key", |
| 286 | key: "foo.bar.t", |
| 287 | m: map[any]any{ |
| 288 | "foo": map[any]any{ |
| 289 | "bar": map[any]any{ |
| 290 | "t1": 10, |
| 291 | }, |
| 292 | }, |
| 293 | }, |
| 294 | }, |
| 295 | { |
| 296 | name: "Level 4 no entry", |
| 297 | key: "foo.bar.t.gh", |
| 298 | m: map[any]any{ |
| 299 | "foo": map[any]any{ |
| 300 | "bar": map[any]any{ |
| 301 | "t1": 10, |
| 302 | }, |
| 303 | }, |
| 304 | }, |
| 305 | }, |
| 306 | { |
| 307 | name: "Level 4 slice entry", |
| 308 | key: "foo.bar.t.gh", |
| 309 | m: map[any]any{ |
| 310 | "foo": map[any]any{ |
| 311 | "bar": map[string]any{ |
| 312 | "t": map[any]any{ |
| 313 | "gh": []int{10}, |
| 314 | }, |
| 315 | }, |
| 316 | }, |
| 317 | }, |
| 318 | val: "[10]", |
| 319 | found: true, |
| 320 | }, |
| 321 | } |
| 322 | |
| 323 | for _, test := range tests { |
| 324 | t.Runscip-go gomod github.com/golang/go/src go1.22 testing/T#Run().(test.key, 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#) { |
| 325 | ms := NewMapSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewMapSource().("test", test.m) |
| 326 | m := NewMapValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewMapValueSource().(test.key, ms) |
| 327 | val, b := m.Lookupscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ValueSource#Lookup.() |
| 328 | if !test.found { |
| 329 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, b) |
| 330 | } else { |
| 331 | 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, b) |
| 332 | 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, val, test.val) |
| 333 | } |
| 334 | }) |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | func TestMapValueSourceStringerscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestMapValueSourceStringer().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 339 | m := map[any]any{ |
| 340 | "foo": map[any]any{ |
| 341 | "bar": 10, |
| 342 | }, |
| 343 | } |
| 344 | mvs := NewMapValueSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewMapValueSource().("bar", NewMapSourcescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewMapSource().("test", m)) |
| 345 | |
| 346 | 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, `&mapValueSource{key:"bar", src:&mapSource{name:"test"}}`, mvs.GoStringscip-go gomod github.com/golang/go/src go1.22 fmt/GoStringer#GoString().()) |
| 347 | 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, `key "bar" from map source "test"`, mvs.Stringscip-go gomod github.com/golang/go/src go1.22 fmt/Stringer#String().()) |
| 348 | } |