add a test case for adding a file with a unicode filename
This fails with ghc 4.7.
This commit is contained in:
parent
275391b1bf
commit
6c64a214fa
1 changed files with 9 additions and 1 deletions
10
test.hs
10
test.hs
|
@ -131,7 +131,7 @@ test_init = "git-annex init" ~: TestCase $ innewrepo $ do
|
||||||
reponame = "test repo"
|
reponame = "test repo"
|
||||||
|
|
||||||
test_add :: Test
|
test_add :: Test
|
||||||
test_add = "git-annex add" ~: TestList [basic, sha1dup, subdirs]
|
test_add = "git-annex add" ~: TestList [basic, sha1dup, sha1unicode, subdirs]
|
||||||
where
|
where
|
||||||
-- this test case runs in the main repo, to set up a basic
|
-- this test case runs in the main repo, to set up a basic
|
||||||
-- annexed file that later tests will use
|
-- annexed file that later tests will use
|
||||||
|
@ -158,6 +158,10 @@ test_add = "git-annex add" ~: TestList [basic, sha1dup, subdirs]
|
||||||
git_annex "add" [sha1annexedfiledup, "--backend=SHA1"] @? "add of second file with same SHA1 failed"
|
git_annex "add" [sha1annexedfiledup, "--backend=SHA1"] @? "add of second file with same SHA1 failed"
|
||||||
annexed_present sha1annexedfiledup
|
annexed_present sha1annexedfiledup
|
||||||
annexed_present sha1annexedfile
|
annexed_present sha1annexedfile
|
||||||
|
sha1unicode = TestCase $ intmpclonerepo $ do
|
||||||
|
writeFile sha1annexedfileunicode $ content sha1annexedfileunicode
|
||||||
|
git_annex "add" [sha1annexedfileunicode, "--backend=SHA1"] @? "add of unicode filename failed"
|
||||||
|
annexed_present sha1annexedfileunicode
|
||||||
subdirs = TestCase $ intmpclonerepo $ do
|
subdirs = TestCase $ intmpclonerepo $ do
|
||||||
createDirectory "dir"
|
createDirectory "dir"
|
||||||
writeFile "dir/foo" $ content annexedfile
|
writeFile "dir/foo" $ content annexedfile
|
||||||
|
@ -919,6 +923,9 @@ sha1annexedfile = "sha1foo"
|
||||||
sha1annexedfiledup :: String
|
sha1annexedfiledup :: String
|
||||||
sha1annexedfiledup = "sha1foodup"
|
sha1annexedfiledup = "sha1foodup"
|
||||||
|
|
||||||
|
sha1annexedfileunicode :: String
|
||||||
|
sha1annexedfileunicode = "foo¡"
|
||||||
|
|
||||||
ingitfile :: String
|
ingitfile :: String
|
||||||
ingitfile = "bar"
|
ingitfile = "bar"
|
||||||
|
|
||||||
|
@ -928,6 +935,7 @@ content f
|
||||||
| f == ingitfile = "normal file content"
|
| f == ingitfile = "normal file content"
|
||||||
| f == sha1annexedfile ="sha1 annexed file content"
|
| f == sha1annexedfile ="sha1 annexed file content"
|
||||||
| f == sha1annexedfiledup = content sha1annexedfile
|
| f == sha1annexedfiledup = content sha1annexedfile
|
||||||
|
| f == sha1annexedfileunicode ="sha1 annexed file content ¡ünicodé!"
|
||||||
| f == wormannexedfile = "worm annexed file content"
|
| f == wormannexedfile = "worm annexed file content"
|
||||||
| otherwise = "unknown file " ++ f
|
| otherwise = "unknown file " ++ f
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue