Add Gen module and propery tests#31
Merged
Merged
Conversation
safareli
commented
Dec 20, 2017
| import Data.Path.Pathy (AbsPath, AbsFile, AbsDir, RelDir, RelFile, RelPath, Sandboxed, (</>)) | ||
| import Data.Path.Pathy as P | ||
|
|
||
| genAbsDirPath :: forall m. MonadGen m => MonadRec m => m String -> m (AbsDir Sandboxed) |
Contributor
Author
There was a problem hiding this comment.
This staff is moved from ps-quasar
safareli
commented
Dec 20, 2017
|
|
||
| parsePrintCheck :: forall a b. Path a b Sandboxed -> Maybe (Path a b Unsandboxed) -> QC.Result | ||
| parsePrintCheck input parsed = | ||
| if parsed == Just (unsandbox input) |
Contributor
Author
There was a problem hiding this comment.
I guess this check is not the best, as I got this error at some point:
checking `parse <<< print` for `RelFile``
97/100 test(s) passed.
/Users/safareli/dev/slamdata/purescript-pathy/output/Control.Monad.Eff.Exception/foreign.js:29
throw e;
^
Error: Test 40 (seed 846546249) failed:
`parse (print path) != Just path` for path: `(((((((((currentDir </> dir "냫笼嬋ఱ护") </> dir "ꘓၷ两뱖쌜") </> dir "沌뢑朿ガ茧") </> dir "ﹱ捴ኧ嵹") </> dir "횽") </> dir "⤋") </> dir "큛रꃙ") </> dir "/솛鼒") </> file "냫笼嬋ఱ护")` which was re-parsed into `(Just (((((((((currentDir </> dir "냫笼嬋ఱ护") </> dir "ꘓၷ两뱖쌜") </> dir "沌뢑朿ガ茧") </> dir "ﹱ捴ኧ嵹") </> dir "횽") </> dir "⤋") </> dir "큛रꃙ") </> dir "솛鼒") </> file "냫笼嬋ఱ护"))`
Printed path: "./냫笼嬋ఱ护/ꘓၷ两뱖쌜/沌뢑朿ガ茧/ﹱ捴ኧ嵹/횽/⤋/큛रꃙ/솛鼒/냫笼嬋ఱ护"
Printed path': `(Just "./냫笼嬋ఱ护/ꘓၷ两뱖쌜/沌뢑朿ガ茧/ﹱ捴ኧ嵹/횽/⤋/큛रꃙ/솛鼒/냫笼嬋ఱ护")`
if we move show-ed values side by side difference becomes more clear (scroll to right end)
(((((((((currentDir </> dir "냫笼嬋ఱ护") </> dir "ꘓၷ两뱖쌜") </> dir "沌뢑朿ガ茧") </> dir "ﹱ捴ኧ嵹") </> dir "횽") </> dir "⤋") </> dir "큛रꃙ") </> dir "/솛鼒") </> file "냫笼嬋ఱ护")
(((((((((currentDir </> dir "냫笼嬋ఱ护") </> dir "ꘓၷ两뱖쌜") </> dir "沌뢑朿ガ茧") </> dir "ﹱ捴ኧ嵹") </> dir "횽") </> dir "⤋") </> dir "큛रꃙ") </> dir "솛鼒") </> file "냫笼嬋ఱ护")
The different part:
... </> dir "/솛鼒") </> file "냫笼嬋ఱ护")
... </> dir "솛鼒") </> file "냫笼嬋ఱ护")
Contributor
Author
There was a problem hiding this comment.
Used alpha numeric generator in resent amend so this issue is not going to occur
cryogenian
reviewed
Dec 20, 2017
cryogenian
left a comment
Member
There was a problem hiding this comment.
There is a module that produces alphaNumString
| import Data.String.Gen as SG | ||
|
|
||
| genName ∷ ∀ m. MonadGen m ⇒ MonadRec m ⇒ m String | ||
| genName = SG.genString $ Gen.oneOf $ CG.genDigitChar :| [CG.genAlpha] |
Member
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
But we have no dependency on that.
Contributor
Author
|
@cryogenian is this fine to merge? |
Member
|
Oh, we don't have strongcheck here, weird... |
cryogenian
approved these changes
Dec 21, 2017
Contributor
Author
|
made 4.1.0 release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.