Skip to content

add support for building tests with ghc-8.8 #15

@cdepillabout

Description

@cdepillabout

When building the tests for semver-range with ghc-8.8.2, I get the following errors:

Preprocessing test suite 'unit-tests' for semver-range-0.2.8..
Building test suite 'unit-tests' for semver-range-0.2.8..

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules:
        Data.SemVer Data.SemVer.Parser Data.SemVer.Types
[1 of 4] Compiling Data.SemVer.Types ( src/Data/SemVer/Types.hs, dist/build/unit-tests/unit-tests-tmp/Data/SemVer/Types.o )
[2 of 4] Compiling Data.SemVer.Parser ( src/Data/SemVer/Parser.hs, dist/build/unit-tests/unit-tests-tmp/Data/SemVer/Parser.o )
[3 of 4] Compiling Data.SemVer      ( src/Data/SemVer.hs, dist/build/unit-tests/unit-tests-tmp/Data/SemVer.o )
[4 of 4] Compiling Main             ( tests/Unit.hs, dist/build/unit-tests/unit-tests-tmp/Main.o )

tests/Unit.hs:319:26: error:
    • Variable not in scope: fail :: String -> Expectation
    • Perhaps you meant one of these:
        ‘fail_’ (line 316), ‘tail’ (imported from ClassyPrelude),
        ‘T.tail’ (imported from Data.Text)
    |
319 |         (Left err, _) -> fail $ "Semver range parse failed: " <> show err
    |                          ^^^^

tests/Unit.hs:320:26: error:
    • Variable not in scope: fail :: String -> Expectation
    • Perhaps you meant one of these:
        ‘fail_’ (line 316), ‘tail’ (imported from ClassyPrelude),
        ‘T.tail’ (imported from Data.Text)
    |
320 |         (_, Left err) -> fail $ "Semver parse failed: " <> show err
    |                          ^^^^

I believe this is because of the monadfail changes in 8.8:

https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.8#base-41300

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions