1 import Test
.Cabal
.Prelude
3 workdir
<- fmap testWorkDir getTestEnv
4 let conf
= workdir
</> "cabal-config"
5 cabalG
["--config-file", conf
] "user-config" ["init"]
7 fails
$ cabalG
["--config-file", workdir
</> "cabal-config"] "user-config" ["init"]
8 cabalG
["--config-file", conf
] "user-config" ["-f", "init"]
10 let conf2
= workdir
</> "cabal-config2"
11 withEnv
[("CABAL_CONFIG", Just conf2
)] $ do
12 cabal
"user-config" ["init"]
14 cabalG
["--config-file", conf
] "user-config" ["update", "-f", "-a", "extra-prog-path: foo", "-a", "extra-prog-path: bar"]
15 assertFileDoesContain conf
"foo,bar"
16 cabalG
["--config-file", conf
] "user-config" ["update", "-f", "-a", "extra-prog-path: foo, bar"]
17 assertFileDoesContain conf
"foo,bar"
19 -- regression test for #6268 (password-command parsing)
20 cabalG
["--config-file", conf
]
21 "user-config" ["update", "-f", "-a", "password-command: sh -c \"echo secret\""]
22 -- non-quoted tokens do get quoted when writing, but this is expected
23 assertFileDoesContain conf
"password-command: \"sh\" \"-c\" \"echo secret\""