Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: the ForQuickCheck printer produces syntactically invalid tests when run in series: #57

Open
isovector opened this issue Jun 25, 2020 · 1 comment

Comments

@isovector
Copy link
Contributor

note to self:

== Laws ==                                                                                   
quickspec_laws :: [(String, Property)]                                                       
quickspec_laws =                                                                             
  [ ( "cat x failMatch = failMatch"                                                          
    , property $                                                                             
        \ (x :: Regex Bool3) ->                                                              
            cat x failMatch =~= failMatch)                                                   
  , ( "cat failMatch x = failMatch"                                                          
    , property $                                                                             
        \ (x :: Regex Bool3) ->                                                              
            cat failMatch x =~= failMatch)                                                   
  , ( "cat (cat x y) z = cat x (cat y z)"                                                    
    , property $                                                                             
        \ (x :: Regex Bool3)                                                                 
          (y :: Regex Bool3)                                                                 
          (z :: Regex Bool3) ->                                                              
            cat (cat x y) z =~= cat x (cat y z))                                             
  ]                                                                                          
                                                                                             
== Functions ==                                                                              
(/=) :: Char -> Char -> Bool                                                                 
both :: Regex Bool3 -> Regex Bool3 -> Regex Bool3                                            
                                                                                             
== Laws ==                                                                                   
quickspec_laws :: [(String, Property)]                                                       
quickspec_laws =                                                                             
  , ( "x /= y = y /= x"  --  <-- uh oh! there is no opening [ here
    , property $ 
@isovector
Copy link
Contributor Author

I'm not entirely sure what should happen here. Perhaps the == blocks should be emitted as comments in quickspec mode, and the quickspec_laws preamble should only be generated once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant