From: Ramakrishnan Muthukrishnan Date: Wed, 4 Feb 2015 11:56:12 +0000 (+0530) Subject: lists: more tests X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/@@named=//%22%3C?a=commitdiff_plain;h=52cac1a75ce39a9e21a923cdd40d2e7e5f517878;p=functorrent.git lists: more tests --- diff --git a/src/Bencode.hs b/src/Bencode.hs index e1f6dd3..7fbea96 100644 --- a/src/Bencode.hs +++ b/src/Bencode.hs @@ -75,7 +75,10 @@ bencInt = do _ <- spaces -- Right [] -- >>> parse bencList "Blist" (BC.pack "l4:spam4:eggse") -- Right ["spam","eggs"] - +-- >>> parse bencList "Blist" (BC.pack "l4:spami42ee") +-- Right ["spam",42] +-- >>> parse bencList "Blist" (BC.pack "l4:spam4:eggsli42eee") +-- Right ["spam","eggs",[42]] bencList :: ParsecBS.Parser [BVal] bencList = do _ <- spaces between (char 'l') (char 'e') (many bencVal)