1module Tests.Shared (tests) where
3import System.FilePath.Posix (joinPath)
5import Test.Tasty.HUnit (assertBool, (@?=), testCase)
6import Text.Pandoc.Arbitrary ()
7import Text.Pandoc.Builder
8import Text.Pandoc.Shared
11tests = [ testGroup "compactifyDL"
12 [ testCase "compactifyDL with empty def" $
13 assertBool "compactifyDL"
14 (let x = [(str "word", [para (str "def"), mempty])]
15 in compactifyDL x == x)
17 , testGroup "collapseFilePath" testCollapse
20testCollapse :: [TestTree]
21testCollapse = map (testCase "collapse")
22 [ (collapseFilePath (joinPath [ ""]) @?= (joinPath [ ""]))
23 , (collapseFilePath (joinPath [ ".","foo"]) @?= (joinPath [ "foo"]))
24 , (collapseFilePath (joinPath [ ".",".","..","foo"]) @?= (joinPath [ joinPath ["..", "foo"]]))
25 , (collapseFilePath (joinPath [ "..","foo"]) @?= (joinPath [ "..","foo"]))
26 , (collapseFilePath (joinPath [ "","bar","..","baz"]) @?= (joinPath [ "","baz"]))
27 , (collapseFilePath (joinPath [ "","..","baz"]) @?= (joinPath [ "","..","baz"]))
28 , (collapseFilePath (joinPath [ ".","foo","..",".","bar","..",".",".","baz"]) @?= (joinPath [ "baz"]))
29 , (collapseFilePath (joinPath [ ".",""]) @?= (joinPath [ ""]))
30 , (collapseFilePath (joinPath [ ".",".",""]) @?= (joinPath [ ""]))
31 , (collapseFilePath (joinPath [ "..",""]) @?= (joinPath [ ".."]))
32 , (collapseFilePath (joinPath [ "..",".",""]) @?= (joinPath [ ".."]))
33 , (collapseFilePath (joinPath [ ".","..",""]) @?= (joinPath [ ".."]))
34 , (collapseFilePath (joinPath [ "..","..",""]) @?= (joinPath [ "..",".."]))
35 , (collapseFilePath (joinPath [ "parent","foo","baz","..","bar"]) @?= (joinPath [ "parent","foo","bar"]))
36 , (collapseFilePath (joinPath [ "parent","foo","baz","..","..","bar"]) @?= (joinPath [ "parent","bar"]))
37 , (collapseFilePath (joinPath [ "parent","foo",".."]) @?= (joinPath [ "parent"]))
38 , (collapseFilePath (joinPath [ "","parent","foo","..","..","bar"]) @?= (joinPath [ "","bar"]))
39 , (collapseFilePath (joinPath [ "",".","parent","foo"]) @?= (joinPath [ "","parent","foo"]))]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list