lists: more tests
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 4 Feb 2015 11:56:12 +0000 (17:26 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Wed, 4 Feb 2015 11:56:12 +0000 (17:26 +0530)
src/Bencode.hs

index e1f6dd33d802652b56d78d4d3375124d659fd8fe..7fbea96e386800e9591a8f690ed5c407b7adc94d 100644 (file)
@@ -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)