Related to https://github.com/spf13/cobra/issues/521.
(t *testing.T)
| 1807 | |
| 1808 | // Related to https://github.com/spf13/cobra/issues/521. |
| 1809 | func TestNormPassedOnLocal(t *testing.T) { |
| 1810 | toUpper := func(f *pflag.FlagSet, name string) pflag.NormalizedName { |
| 1811 | return pflag.NormalizedName(strings.ToUpper(name)) |
| 1812 | } |
| 1813 | |
| 1814 | c := &Command{} |
| 1815 | c.Flags().Bool("flagname", true, "this is a dummy flag") |
| 1816 | c.SetGlobalNormalizationFunc(toUpper) |
| 1817 | if c.LocalFlags().Lookup("flagname") != c.LocalFlags().Lookup("FLAGNAME") { |
| 1818 | t.Error("Normalization function should be passed on to Local flag set") |
| 1819 | } |
| 1820 | } |
| 1821 | |
| 1822 | // Related to https://github.com/spf13/cobra/issues/521. |
| 1823 | func TestNormPassedOnInherited(t *testing.T) { |
nothing calls this directly
no test coverage detected