test case for view
authorJoey Hess <joeyh@joeyh.name>
Mon, 2 Nov 2020 19:06:55 +0000 (15:06 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 2 Nov 2020 19:06:55 +0000 (15:06 -0400)
For reversion fixed in 9252f86b2e9a3ee218867e1ef4572766eb44418c

This commit was sponsored by Ethan Aubin

Test.hs

diff --git a/Test.hs b/Test.hs
index b9d4a7d130162e47e251a5d516893715084aaa3d..94b400954fab4b8c6351d24f8b4f531356d33a16 100644 (file)
--- a/Test.hs
+++ b/Test.hs
@@ -298,6 +298,7 @@ unitTests note = testGroup ("Unit Tests " ++ note)
        , testCase "export_import_subdir" test_export_import_subdir
        , testCase "shared clone" test_shared_clone
        , testCase "log" test_log
+       , testCase "view" test_view
        , testCase "magic" test_magic
        , testCase "import" test_import
        , testCase "reinject" test_reinject
@@ -447,6 +448,14 @@ test_log :: Assertion
 test_log = intmpclonerepo $ do
        git_annex "log" [annexedfile] @? "log failed"
 
+test_view :: Assertion
+test_view = intmpclonerepo $ do
+       git_annex "metadata" ["-s", "test=test1", annexedfile]  @? "metadata failed"
+       git_annex "metadata" ["-s", "test=test2", sha1annexedfile]  @? "metadata failed"
+       git_annex "view" ["test=test1"] @? "entering view failed"
+       checkexists annexedfile
+       checkdoesnotexist sha1annexedfile
+
 test_magic :: Assertion
 test_magic = intmpclonerepo $ do
 #ifdef WITH_MAGICMIME