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

Can't run the tests #25

Closed
erikd opened this issue Sep 4, 2016 · 5 comments
Closed

Can't run the tests #25

erikd opened this issue Sep 4, 2016 · 5 comments

Comments

@erikd
Copy link

erikd commented Sep 4, 2016

Having an incredible amount of difficulty simply running the tests.

In PR #23 I mentioned this and you said you run the tests in GHCi. I tried, but this is rather non-trivial because I'm running in a cabal sandbox:

$ cabal exec -- ghci -itest test/Test/Hspec/ExpectationsSpec.hs 
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help

test/Test/Hspec/ExpectationsSpec.hs:11:18:
    Could not find module ‘Test.Hspec’
    Use -v to see a list of the files searched for.
Failed, modules loaded: none.

So I installed hspec and tried again, only to get a number of errors like:

test/Test/Hspec/ExpectationsSpec.hs:61:7: Warning:
    No instance for (Data.String.IsString (t0 a0))
      arising from the literal ‘""’
    The type variables ‘t0’, ‘a0’ are ambiguous
    Note: there is a potential instance available:
      instance Data.String.IsString [Char] -- Defined in ‘Data.String’
    In the first argument of ‘shouldSatisfy’, namely ‘""’
    In a stmt of a 'do' block: "" `shouldSatisfy` null
    In the second argument of ‘($)’, namely
      ‘do { "" `shouldSatisfy` null }’

On top of that, the lack of any tests in the cabal file means that the travis script can't build and run the tests.

So I tried to add a testsuite section to the cabal file only to find that the there seems to be a circular dependency between hspec-expectations and hspec and hspec-discover that cabal doesn't seem to be able to resolve. The solution seems to be to test hspec-expectations with something other than hspec itself.

Would you accept a PR that adds a proper working testsuite section to the cabal file?

@sol
Copy link
Member

sol commented Sep 4, 2016

I think the issue is due to the AMP changes. null is too generic now. I guess we should fix that first.

We could try to use nanospec for testing, but I guess there is a reason why it's currently not like that...

Sent from mobile

On 4 Sep 2016, at 9:39 AM, Erik de Castro Lopo notifications@github.com wrote:

Having an incredible amount of difficulty simply running the tests.

In PR #23 I mentioned this and you said you run the tests in GHCi. I tried, but this is rather non-trivial because I'm running in a cabal sandbox:

$ cabal exec -- ghci -itest test/Test/Hspec/ExpectationsSpec.hs
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help

test/Test/Hspec/ExpectationsSpec.hs:11:18:
Could not find module ‘Test.Hspec’
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
So I installed hspec and tried again, only to get a number of errors like:

test/Test/Hspec/ExpectationsSpec.hs:61:7: Warning:
No instance for (Data.String.IsString (t0 a0))
arising from the literal ‘""’
The type variables ‘t0’, ‘a0’ are ambiguous
Note: there is a potential instance available:
instance Data.String.IsString [Char] -- Defined in ‘Data.String’
In the first argument of ‘shouldSatisfy’, namely ‘""’
In a stmt of a 'do' block: "" shouldSatisfy null
In the second argument of ‘($)’, namely
‘do { "" shouldSatisfy null }’
On top of that, the lack of any tests in the cabal file means that the travis script can't be built and run the tests.

So I tried to add a testsuite section to the cabal file only to find that the there seems to be a circular dependency between hspec-expectations and hspec and hspec-discover that cabal doesn't seem to be able to resolve. The solution seems to be to test hspec-expectations with something other than hspec itself.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@sol
Copy link
Member

sol commented Sep 4, 2016

I guess we should run with runhaskell on Travis

Sent from mobile

On 4 Sep 2016, at 9:39 AM, Erik de Castro Lopo notifications@github.com wrote:

Having an incredible amount of difficulty simply running the tests.

In PR #23 I mentioned this and you said you run the tests in GHCi. I tried, but this is rather non-trivial because I'm running in a cabal sandbox:

$ cabal exec -- ghci -itest test/Test/Hspec/ExpectationsSpec.hs
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help

test/Test/Hspec/ExpectationsSpec.hs:11:18:
Could not find module ‘Test.Hspec’
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
So I installed hspec and tried again, only to get a number of errors like:

test/Test/Hspec/ExpectationsSpec.hs:61:7: Warning:
No instance for (Data.String.IsString (t0 a0))
arising from the literal ‘""’
The type variables ‘t0’, ‘a0’ are ambiguous
Note: there is a potential instance available:
instance Data.String.IsString [Char] -- Defined in ‘Data.String’
In the first argument of ‘shouldSatisfy’, namely ‘""’
In a stmt of a 'do' block: "" shouldSatisfy null
In the second argument of ‘($)’, namely
‘do { "" shouldSatisfy null }’
On top of that, the lack of any tests in the cabal file means that the travis script can't be built and run the tests.

So I tried to add a testsuite section to the cabal file only to find that the there seems to be a circular dependency between hspec-expectations and hspec and hspec-discover that cabal doesn't seem to be able to resolve. The solution seems to be to test hspec-expectations with something other than hspec itself.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@erikd
Copy link
Author

erikd commented Sep 4, 2016

Its not AMP because I get very similar problems with ghc 7.8.

@sol
Copy link
Member

sol commented Sep 5, 2016

Do you have OverloadedStrings in your global .ghci?

@erikd
Copy link
Author

erikd commented Sep 5, 2016

Yes, that may be it.

@sol sol closed this as completed in c385076 Sep 6, 2016
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

2 participants