test metadata
This commit is contained in:
parent
24550e010b
commit
ba345e90b5
2 changed files with 27 additions and 0 deletions
19
Test.hs
19
Test.hs
|
@ -292,6 +292,7 @@ unitTests :: String -> TestTree
|
||||||
unitTests note = testGroup ("Unit Tests " ++ note)
|
unitTests note = testGroup ("Unit Tests " ++ note)
|
||||||
[ testCase "add dup" test_add_dup
|
[ testCase "add dup" test_add_dup
|
||||||
, testCase "add extras" test_add_extras
|
, testCase "add extras" test_add_extras
|
||||||
|
, testCase "metadata" test_metadata
|
||||||
, testCase "export_import" test_export_import
|
, testCase "export_import" test_export_import
|
||||||
, testCase "export_import_subdir" test_export_import_subdir
|
, testCase "export_import_subdir" test_export_import_subdir
|
||||||
, testCase "shared clone" test_shared_clone
|
, testCase "shared clone" test_shared_clone
|
||||||
|
@ -402,6 +403,24 @@ test_add_extras = intmpclonerepo $ do
|
||||||
annexed_present wormannexedfile
|
annexed_present wormannexedfile
|
||||||
checkbackend wormannexedfile backendWORM
|
checkbackend wormannexedfile backendWORM
|
||||||
|
|
||||||
|
test_metadata :: Assertion
|
||||||
|
test_metadata = intmpclonerepo $ do
|
||||||
|
git_annex "metadata" ["-s", "foo=bar", annexedfile] @? "set metadata"
|
||||||
|
git_annex_expectoutput "find" ["--metadata", "foo=bar"] [annexedfile]
|
||||||
|
git_annex_expectoutput "find" ["--metadata", "foo=other"] []
|
||||||
|
writecontent annexedfiledup $ content annexedfiledup
|
||||||
|
add_annex annexedfiledup @? "add of second file with same content failed"
|
||||||
|
annexed_present annexedfiledup
|
||||||
|
git_annex_expectoutput "find" ["--metadata", "foo=bar"]
|
||||||
|
[annexedfile, annexedfiledup]
|
||||||
|
git_annex_shouldfail "metadata" ["--remove", "foo", "."]
|
||||||
|
@? "removing metadata from dir with multiple files failed to fail"
|
||||||
|
git_annex "metadata" ["--remove", "foo", annexedfile]
|
||||||
|
@? "removing metadata failed"
|
||||||
|
git_annex_expectoutput "find" ["--metadata", "foo=bar"] []
|
||||||
|
git_annex "metadata" ["--force", "-s", "foo=bar", "."]
|
||||||
|
@? "recursively set metadata force"
|
||||||
|
|
||||||
test_shared_clone :: Assertion
|
test_shared_clone :: Assertion
|
||||||
test_shared_clone = intmpsharedclonerepo $ do
|
test_shared_clone = intmpsharedclonerepo $ do
|
||||||
v <- catchMaybeIO $ Utility.Process.readProcess "git"
|
v <- catchMaybeIO $ Utility.Process.readProcess "git"
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 2"""
|
||||||
|
date="2020-07-13T16:43:35Z"
|
||||||
|
content="""
|
||||||
|
Also the test case was not testing the metadata command at all, added some
|
||||||
|
tests.
|
||||||
|
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue