Commit Graph

129 Commits

Author SHA1 Message Date
mrkkrp
4de9da0bbc Fix a typo in the test suite 2016-11-25 18:09:37 +03:00
Mark Karpov
dd2386aafc Add ‘MonadParsec’ instance for ‘RWST’ (#152) 2016-11-21 19:18:27 +04:00
mrkkrp
e6c5c2beed Fix building with QuickCheck older than 2.9.0 2016-10-06 22:37:40 +03:00
mrkkrp
0367967161 Avoid flood of debugging info on testing 2016-10-06 22:30:28 +03:00
mrkkrp
dcf484889d Increase coverage 2016-10-03 12:37:30 +03:00
mrkkrp
3a147e6cde Add tests for the new ‘observing’ primitive 2016-10-02 19:38:50 +03:00
mrkkrp
4e3a36ef93 Add tests for the new ‘dbg’ function 2016-09-30 13:35:02 +03:00
mrkkrp
9fd109d0e8 Improve coverage of some primitives 2016-09-27 11:42:13 +03:00
mrkkrp
6772b88e93 Make ‘try’ truly backtrack parser state
Close #142.

This seemingly has no effect on performance.
2016-09-27 09:41:23 +03:00
mrkkrp
dfbc6f0893 Minor corrections in test suite, improve coverage 2016-09-27 00:23:17 +03:00
mrkkrp
bd07032795 Fix the build 2016-09-25 18:42:21 +03:00
mrkkrp
6da7f86350 Migrate the test suite to Hspec 2016-09-24 19:32:50 +03:00
mrkkrp
82994e45d4 Allow line comments end with end of input
Close #119.
2016-08-13 20:00:49 +03:00
mrkkrp
6a7c41d889 Don't allow very big values of ‘Pos’ in tests
This is unrealistic and leads to false failures.
2016-08-04 09:38:54 +03:00
mrkkrp
7beca0c585 Fix the build with ‘QuickCheck-2.9’ and later 2016-07-24 13:06:52 +03:00
mrkkrp
e39fd663ca Minor corrections and add test for ‘lineFold’ 2016-05-10 22:51:40 +07:00
mrkkrp
a74bcd1499 Add ‘checkCase’ (rename old one to ‘checkCase'’) 2016-05-10 22:51:23 +07:00
mrkkrp
dc63a8f893 Add tests to cover new API for position advancing
Close #102.
2016-05-04 00:53:09 +07:00
mrkkrp
59c01cba67 Improve some existing tests to increase coverage 2016-05-02 21:51:06 +07:00
mrkkrp
2385cf5867 Add a test for ‘parseMaybe’ 2016-04-30 19:02:26 +07:00
mrkkrp
49303f18c4 Add a trivial test for ‘MonadIO’ instance 2016-04-30 18:32:50 +07:00
mrkkrp
2eddd78f0f Tests for ‘updatePos’ (different types of streams) 2016-04-30 18:22:00 +07:00
mrkkrp
3195a97776 Add new tests for ‘showTokens’ and pretty-printing 2016-04-30 17:31:52 +07:00
mrkkrp
1094408b96 Add ‘pushPosition’ and ‘popPosition’
Close #83.
2016-04-27 00:04:56 +07:00
mrkkrp
8e095bab8c A correction to ‘getPosition’ and ‘setPosition’
Make ‘getPosition’ and ‘setPosition’ work with current file, not with
the whole stack.
2016-04-26 23:01:09 +07:00
mrkkrp
f22cd69ff7 Cosmetic polishing 2016-04-26 00:37:06 +07:00
mrkkrp
13578590da Adjustments for compatibility 2016-04-25 19:51:13 +07:00
mrkkrp
f576945a4a Update tests for ‘Text.Megaparsec.Lexer’ 2016-04-24 21:56:45 +07:00
mrkkrp
e11066f07a Update tests for ‘Text.Megaparsec.Expr’ 2016-04-24 21:56:45 +07:00
mrkkrp
98b08b752a Update tests for ‘Text.Megaparsec.Prim’ 2016-04-24 21:56:45 +07:00
mrkkrp
643842ac1e Update tests for ‘Text.Megaparsec.Perm’ 2016-04-24 21:56:45 +07:00
mrkkrp
9089ed3325 Update tests for ‘Text.Megaparsec.Combinator’ 2016-04-24 21:56:45 +07:00
mrkkrp
6f69306515 Update tests for ‘Text.Megaparsec.Char’ 2016-04-24 21:56:45 +07:00
mrkkrp
35dc3a4469 Write tests for the new ‘Text.Megaparsec.Error’ 2016-04-24 21:56:40 +07:00
mrkkrp
14b1aeea8a Write tests for the new ‘Text.Megaparsec.Pos’ 2016-04-24 20:21:36 +07:00
mrkkrp
a1df59221b Update ‘Util’ module in test suite 2016-04-24 20:21:07 +07:00
mrkkrp
a3254f5371 Move language extensions to files
This turns out that it's easier for readers to lookup the list of
extensions in current file than go to Cabal file.
2016-04-10 19:26:54 +07:00
mrkkrp
747993e0bb Add ‘skipBlockCommentNested’ function
Close #96.
2016-03-30 14:50:35 +06:00
mrkkrp
18d192ba70 Use ‘Scientific’ as target type for floats
Close #95.

Here we introduce ‘scientific’ parser that can parse arbitrary big
numbers without error or memory overflow. ‘float’ still returns
‘Double’, but it's defined in terms of ‘scientific’ now. Since
‘Scientific’ type can reliably represent integer values as well as
floating point values, ‘number’ now returns ‘Scientific’ instead of
‘Either Integer Double’ (‘Integer’ or ‘Double’ can be extracted from
‘Scientific’ value anyway). This in turn makes ‘signed’ parser more
natural and general, because we do not need ad-hoc ‘Signed’ type class
anymore.
2016-03-29 16:42:51 +06:00
mrkkrp
aa805864af Add simple tests for ‘Text’ and ‘ByteString’
These are primitive tests, but nevertheless they check ‘uncons’ and
‘updatePos’ — everything we need.
2016-03-29 09:19:50 +06:00
mrkkrp
00ae88a8e7 Add a test to check that ‘tokens’ never consumes 2016-03-28 22:51:07 +06:00
mrkkrp
ac99fc0fac More flexible position-advancing function
This should improve experience of users who use Megaparsec with Alex and
Happy. The commit also introduces some minor changes in
‘Text.Megaparsec.Pos’ module (improving argument order).
2016-03-24 18:12:25 +06:00
recursion-ninja
dccfc82152 Replace ‘String’ with ‘Foldable f => f Char’
The commit also deals with GHC 8 warnings about redundant constraints.
2016-03-11 15:52:55 +06:00
mrkkrp
eef1fa7ea9 Further improve coverage 2016-02-19 16:15:32 +06:00
mrkkrp
75512ddde5 Use ‘mzero’ to fail (tests) 2016-02-19 16:04:49 +06:00
mrkkrp
bfe173ff07 Improve coverage of primitive combinators 2016-02-19 15:16:26 +06:00
mrkkrp
4c34c488cc Remove ‘Enum’ instance of ‘Message’
This was Parsec's legacy that we should eliminate now. ‘Message’ does
not constitute enumeration, ‘toEnum’ was never properly defined for
it. The idea to use ‘fromEnum’ to determine type of ‘Message’ is also
ugly, for this purpose new functions ‘isUnexpected’, ‘isExpected’, and
‘isMessage’ are defined in ‘Text.Megaparsec.Error’.
2016-02-18 16:26:29 +06:00
mrkkrp
52b41d4992 Add the ‘eitherP’ combinator
Close #85.
2016-02-18 14:46:55 +06:00
mrkkrp
e9df1ba30a Correct ‘withRecovery’ so that it passes the tests 2016-02-18 13:09:19 +06:00
mrkkrp
4ff95dd2a8 Add tests for ‘withRecovery’ primitive 2016-02-18 02:07:08 +06:00