diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-10 15:20:07 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-10 15:20:07 -0400 |
commit | d65d275047d107360faad719850778b1fd67195b (patch) | |
tree | 7268c36f762f4b2da8a718105d92c2763f12789d /Test.hs | |
parent | 028a304854a03020a7df3cd804aef25862998ab9 (diff) |
test case for addurl file://
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -227,6 +227,7 @@ unitTests note = testGroup ("Unit Tests " ++ note) , testCase "crypto" test_crypto , testCase "preferred content" test_preferred_content , testCase "add subdirs" test_add_subdirs + , testCase "addurl" test_addurl ] -- this test case create the main repo @@ -1356,6 +1357,16 @@ test_add_subdirs = intmpclonerepo $ do setCurrentDirectory "dir" git_annex "add" [".." </> "dir2"] @? "add of ../subdir failed" +test_addurl :: Assertion +test_addurl = intmpclonerepo $ do + -- file:// only; this test suite should not hit the network + f <- absPath "myurl" + writeFile f "foo" + git_annex "addurl" ["file://" ++ f] @? "addurl failed on file:// url" + let dest = "addurlurldest" + git_annex "addurl" ["--file", dest, "file://" ++ f] @? "addurl failed on file:// url with --file" + doesFileExist dest @? (dest ++ " missing after addurl --file") + -- This is equivilant to running git-annex, but it's all run in-process -- so test coverage collection works. git_annex :: String -> [String] -> IO Bool |