diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Data/Torrent/ClientSpec.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Data/Torrent/ClientSpec.hs b/tests/Data/Torrent/ClientSpec.hs new file mode 100644 index 00000000..f02a3b1f --- /dev/null +++ b/tests/Data/Torrent/ClientSpec.hs | |||
@@ -0,0 +1,16 @@ | |||
1 | module Data.Torrent.ClientSpec (spec) where | ||
2 | |||
3 | import Data.Version | ||
4 | import Test.Hspec | ||
5 | |||
6 | import Data.Torrent.Client | ||
7 | import Network.BitTorrent.Core.PeerId | ||
8 | |||
9 | spec :: Spec | ||
10 | spec = do | ||
11 | describe "client info" $ do | ||
12 | it "decode azureus encoded peer id" $ do | ||
13 | clientInfo "-AZ2060-xxxxxxxxxxxx" `shouldBe` | ||
14 | ClientInfo IAzureus (ClientVersion (Version [2060] [])) | ||
15 | clientInfo "-BS0000-xxxxxxxxxxxx" `shouldBe` | ||
16 | ClientInfo IBTSlave (ClientVersion (Version [0] [])) | ||