forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request commercialhaskell#2085 from phadej/issue-2084
Resolve commercialhaskell#2084: Rewrite solver output parseLine using regexp
- Loading branch information
Showing
8 changed files
with
96 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
-- | Test suite for "Stack.Solver" | ||
module Stack.SolverSpec where | ||
|
||
import Data.Text (unpack) | ||
import Stack.Types | ||
import Test.Hspec | ||
import qualified Data.Map as Map | ||
|
||
import Stack.Solver | ||
|
||
spec :: Spec | ||
spec = | ||
describe "Stack.Solver" $ do | ||
successfulExample | ||
"text-1.2.1.1 (latest: 1.2.2.0) -integer-simple (via: parsec-3.1.9) (new package)" | ||
$(mkPackageName "text") | ||
$(mkVersion "1.2.1.1") | ||
[ ($(mkFlagName "integer-simple"), False) | ||
] | ||
successfulExample | ||
"hspec-snap-1.0.0.0 *test (via: servant-snap-0.5) (new package)" | ||
$(mkPackageName "hspec-snap") | ||
$(mkVersion "1.0.0.0") | ||
[] | ||
successfulExample | ||
"time-locale-compat-0.1.1.1 -old-locale (via: http-api-data-0.2.2) (new package)" | ||
$(mkPackageName "time-locale-compat") | ||
$(mkVersion "0.1.1.1") | ||
[ ($(mkFlagName "old-locale"), False) | ||
] | ||
successfulExample | ||
"flowdock-rest-0.2.0.0 -aeson-compat *test (via: haxl-fxtra-0.0.0.0) (new package)" | ||
$(mkPackageName "flowdock-rest") | ||
$(mkVersion "0.2.0.0") | ||
[ ($(mkFlagName "aeson-compat"), False) | ||
] | ||
where | ||
successfulExample input pkgName pkgVersion flags = | ||
it ("parses " ++ unpack input) $ | ||
parseCabalOutputLine input `shouldBe` Right (pkgName, (pkgVersion, Map.fromList flags)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,4 @@ extra-deps: | |
- x509-system-1.6.3 | ||
- http-client-tls-0.2.4 | ||
- connection-0.2.5 | ||
- regex-applicative-text-0.1.0.1 |
This file contains 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