Skip to content

Commit

Permalink
Add Stackage badge! 馃弲
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio Corpa committed Feb 6, 2020
1 parent 105a9ae commit f2c848c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Actions Status](https://github.com/kutyel/avro-parser-haskell/workflows/Haskell%20CI/badge.svg)](https://github.com/kutyel/avro-parser-haskell/actions)
[![Hackage](https://img.shields.io/hackage/v/language-avro.svg?logo=haskell)](https://hackage.haskell.org/package/language-avro)
[![Stackage Nightly](http://stackage.org/package/language-avro/badge/nightly)](http://stackage.org/nightly/package/language-avro)
[![ormolu](https://img.shields.io/badge/styled%20with-ormolu-blueviolet)](https://github.com/tweag/ormolu)

Language definition and parser for AVRO (`.avdl`) files.
Expand Down
15 changes: 8 additions & 7 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ main = hspec $ do
`shouldBe` (Right $ Enum (TN "Suit" []) [] Nothing (fromList ["SPADES", "DIAMONDS", "CLUBS", "HEARTS"]))
it "should parse named types" $
parse parseSchema "" "example.seed.server.protocol.avro.PeopleResponse"
`shouldBe` ( Right $ NamedType $ TN
{ baseName = "PeopleResponse",
namespace = ["example", "seed", "server", "protocol", "avro"]
}
`shouldBe` ( Right $ NamedType $
TN
{ baseName = "PeopleResponse",
namespace = ["example", "seed", "server", "protocol", "avro"]
}
)
it "should parse simple records" $
parse parseSchema "" simpleRecord
Expand Down Expand Up @@ -197,9 +198,9 @@ main = hspec $ do
parse parseMethod "" "bytes echoBytes(bytes data);"
`shouldBe` (Right $ Method "echoBytes" [Argument Bytes "data"] Bytes Null False)
it "should parse custom type messages" $
let custom = NamedType "TestRecord" in
parse parseMethod "" "TestRecord echo(TestRecord `record`);"
`shouldBe` (Right $ Method "echo" [Argument custom "record"] custom Null False)
let custom = NamedType "TestRecord"
in parse parseMethod "" "TestRecord echo(TestRecord `record`);"
`shouldBe` (Right $ Method "echo" [Argument custom "record"] custom Null False)
it "should parse multiple argument messages" $
parse parseMethod "" "int add(int arg1, int arg2);"
`shouldBe` (Right $ Method "add" [Argument Int "arg1", Argument Int "arg2"] Int Null False)
Expand Down

0 comments on commit f2c848c

Please sign in to comment.