diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-23 04:54:37 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-23 04:54:37 +0400 |
commit | 0d45d13454644224d6eb461225ef938b84adab6a (patch) | |
tree | dbae0e4130e50df0b3e01b7328a657e2ccf5a595 /tests/Data/Torrent | |
parent | e3ee3bf4b174363f55c3af2195bd191e9c0d25b7 (diff) |
Decode shadow style de peer Ids
Diffstat (limited to 'tests/Data/Torrent')
-rw-r--r-- | tests/Data/Torrent/ClientSpec.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/Data/Torrent/ClientSpec.hs b/tests/Data/Torrent/ClientSpec.hs index 94335ae9..c4c08798 100644 --- a/tests/Data/Torrent/ClientSpec.hs +++ b/tests/Data/Torrent/ClientSpec.hs | |||
@@ -1,9 +1,6 @@ | |||
1 | -- | see <http://bittorrent.org/beps/bep_0020.html> | ||
1 | module Data.Torrent.ClientSpec (spec) where | 2 | module Data.Torrent.ClientSpec (spec) where |
2 | |||
3 | import Data.Version | ||
4 | import Test.Hspec | 3 | import Test.Hspec |
5 | |||
6 | import Data.Torrent.Client | ||
7 | import Network.BitTorrent.Core.PeerId | 4 | import Network.BitTorrent.Core.PeerId |
8 | 5 | ||
9 | spec :: Spec | 6 | spec :: Spec |
@@ -16,3 +13,7 @@ spec = do | |||
16 | it "decode azureus encoded peer id" $ do | 13 | it "decode azureus encoded peer id" $ do |
17 | clientInfo "-AZ2060-xxxxxxxxxxxx" `shouldBe` "Azureus-2060" | 14 | clientInfo "-AZ2060-xxxxxxxxxxxx" `shouldBe` "Azureus-2060" |
18 | clientInfo "-BS0000-xxxxxxxxxxxx" `shouldBe` "BTSlave-0" | 15 | clientInfo "-BS0000-xxxxxxxxxxxx" `shouldBe` "BTSlave-0" |
16 | |||
17 | it "decode Shad0w style peer id" $ do | ||
18 | clientInfo "S58B-----xxxxxxxxxxx" `shouldBe` "Shadow-5.8.11" | ||
19 | clientInfo "T58B-----xxxxxxxxxxx" `shouldBe` "BitTornado-5.8.11" | ||