diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-04 15:14:16 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-04 15:27:49 -0400 |
commit | c69cd93af187c55793052db169abe0d3fb33ef60 (patch) | |
tree | 611b8dbf1529dcf3d233e041985dc537634ce40d /Test.hs | |
parent | c45ad7262f979a7836557abcdcd1c7cae106ef7b (diff) |
narrowing test case
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 65 |
1 files changed, 25 insertions, 40 deletions
@@ -187,7 +187,7 @@ unitTests note getenv = testGroup ("Unit Tests " ++ note) , check "sync" test_sync , check "union merge regression" test_union_merge_regression , check "conflict resolution" test_conflict_resolution_movein_bug - , check "sync push regression" test_sync_push_regression + , check "sync push" test_sync_push , check "conflict_resolution (mixed directory and file)" test_mixed_conflict_resolution , check "map" test_map , check "uninit" test_uninit @@ -744,37 +744,6 @@ test_sync env = intmpclonerepo env $ do - sync committed the symlink standin file to the annex. -} git_annex_expectoutput env "find" ["--in", "."] [] -test_sync_push_regression :: TestEnv -> Assertion -test_sync_push_regression env = do - check_mixed_conflict True - check_mixed_conflict False - where - check_mixed_conflict inr1 = withtmpclonerepo env False $ \r1 -> - withtmpclonerepo env False $ \r2 -> do - indir env r1 $ do - writeFile conflictor "conflictor" - git_annex env "add" [conflictor] @? "add conflicter failed" - git_annex env "sync" [] @? "sync failed in r1" - indir env r2 $ do - createDirectory conflictor - writeFile (conflictor </> "subfile") "subfile" - git_annex env "add" [conflictor] @? "add conflicter failed" - git_annex env "sync" [] @? "sync failed in r2" - pair env r1 r2 - let r = if inr1 then r1 else r2 - indir env r $ do - git_annex env "sync" [] @? "sync failed in mixed conflict" - checkmerge r1 - checkmerge r2 - where - conflictor = "conflictor" - variantprefix = conflictor ++ ".variant" - checkmerge d = do - doesDirectoryExist (d </> conflictor) @? (d ++ " conflictor directory missing") - (any (variantprefix `isPrefixOf`) - <$> getDirectoryContents d) - @? (d ++ "conflictor file missing") - {- Regression test for union merge bug fixed in - 0214e0fb175a608a49b812d81b4632c081f63027 -} test_union_merge_regression :: TestEnv -> Assertion @@ -864,14 +833,30 @@ test_mixed_conflict_resolution env = do git_annex env "sync" [] @? "sync failed in mixed conflict" checkmerge "r1" r1 checkmerge "r1" r2 - where - conflictor = "conflictor" - variantprefix = conflictor ++ ".variant" - checkmerge what d = do - doesDirectoryExist (d </> conflictor) @? (d ++ " conflictor directory missing") - l <- getDirectoryContents d - any (variantprefix `isPrefixOf`) l - @? (what ++ " conflictor file missing in: " ++ show l ) + conflictor = "conflictor" + variantprefix = conflictor ++ ".variant" + checkmerge what d = do + doesDirectoryExist (d </> conflictor) @? (d ++ " conflictor directory missing") + l <- getDirectoryContents d + any (variantprefix `isPrefixOf`) l + @? (what ++ " conflictor file missing in: " ++ show l ) + +{- A windows-specific failure of mixed conflict resolution. -} +test_sync_push :: TestEnv -> Assertion +test_sync_push env = check >> check + where + check = withtmpclonerepo env False $ \r1 -> + withtmpclonerepo env False $ \r2 -> do + indir env r1 $ do + writeFile conflictor "conflictor" + git_annex env "add" [conflictor] @? "add conflicter failed" + git_annex env "sync" [] @? "sync failed in r1" + indir env r2 $ do + createDirectory conflictor + writeFile (conflictor </> "subfile") "subfile" + git_annex env "add" [conflictor] @? "add conflicter failed" + git_annex env "sync" [] @? "sync failed in r2" + conflictor = "conflictor" {- Set up repos as remotes of each other. -} pair :: TestEnv -> FilePath -> FilePath -> Assertion |