Skip to content

Commit

Permalink
Add a test for other types and modes
Browse files Browse the repository at this point in the history
  • Loading branch information
tclem committed Jul 31, 2019
1 parent 61186c9 commit 4fa9013
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/Semantic/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ spec = do
let expected = [ TreeEntry NormalMode TreeObject (OID "abcdef") "/this/is/the/path", TreeEntry SymlinkMode BlobObject (OID "17776") "/dev/urandom"]
parseEntries input `shouldBe` expected

it "parses submodules and other types" $ do
let input = "160000 commit 50865e8895c54037bf06c4c1691aa925d030a59d\tgemoji"
let expected = Right $ TreeEntry OtherMode OtherObjectType (OID "50865e8895c54037bf06c4c1691aa925d030a59d") "gemoji"
parseEntry input `shouldBe` expected

where
methodsBlob = makeBlob "def foo\nend\n" "methods.rb" Ruby mempty

0 comments on commit 4fa9013

Please sign in to comment.