(t *testing.T)
| 116 | } |
| 117 | |
| 118 | func TestFilePaths(t *testing.T) { |
| 119 | r := require.New(t) |
| 120 | |
| 121 | fileName := filepath.Join(os.TempDir(), fmt.Sprintf("urfave-cli-tests-some_file_name_%[1]v", rand.Int())) |
| 122 | t.Cleanup(func() { _ = os.Remove(fileName) }) |
| 123 | |
| 124 | r.Nil(os.WriteFile(fileName, []byte("Hello"), 0o644)) |
| 125 | |
| 126 | sources := Files("junk_file_name", fileName) |
| 127 | str, src, ok := sources.LookupWithSource() |
| 128 | r.True(ok) |
| 129 | r.Equal(str, "Hello") |
| 130 | r.Contains(src.String(), fmt.Sprintf("%[1]q", fileName)) |
| 131 | } |
| 132 | |
| 133 | func TestValueSourceChainEnvKeys(t *testing.T) { |
| 134 | chain := NewValueSourceChain( |
nothing calls this directly
no test coverage detected