-
Notifications
You must be signed in to change notification settings - Fork 841
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 #4339 from akshaymankar/dependency-tree
Add option to print dependencies as tree First part of #4101
- Loading branch information
Showing
7 changed files
with
121 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Control.Monad (when) | ||
import StackTest | ||
|
||
main :: IO () | ||
main = do | ||
stackCheckStdout ["ls", "dependencies", "--tree"] $ \stdOut -> do | ||
let expected = unlines [ "Packages" | ||
, "└─┬ files mkVersion [0,1,0,0]" | ||
, " ├─┬ base mkVersion [4,11,1,0]" | ||
, " │ ├─┬ ghc-prim mkVersion [0,5,2,0]" | ||
, " │ │ └── rts mkVersion [1,0]" | ||
, " │ ├─┬ integer-gmp mkVersion [1,0,2,0]" | ||
, " │ │ └─┬ ghc-prim mkVersion [0,5,2,0]" | ||
, " │ │ └── rts mkVersion [1,0]" | ||
, " │ └── rts mkVersion [1,0]" | ||
, " └─┬ mtl mkVersion [2,2,2]" | ||
, " ├─┬ base mkVersion [4,11,1,0]" | ||
, " │ ├─┬ ghc-prim mkVersion [0,5,2,0]" | ||
, " │ │ └── rts mkVersion [1,0]" | ||
, " │ ├─┬ integer-gmp mkVersion [1,0,2,0]" | ||
, " │ │ └─┬ ghc-prim mkVersion [0,5,2,0]" | ||
, " │ │ └── rts mkVersion [1,0]" | ||
, " │ └── rts mkVersion [1,0]" | ||
, " └── transformers mkVersion [0,5,5,0]" | ||
] | ||
when (stdOut /= expected) $ | ||
error $ unlines [ "Expected:", expected, "Actual:", stdOut ] | ||
|
||
stackCheckStdout ["ls", "dependencies", "--tree", "--depth=1"] $ \stdOut -> do | ||
let expected = unlines [ "Packages" | ||
, "└─┬ files mkVersion [0,1,0,0]" | ||
, " ├── base mkVersion [4,11,1,0]" | ||
, " └── mtl mkVersion [2,2,2]" | ||
] | ||
when (stdOut /= expected) $ | ||
error $ unlines [ "Expected:", expected, "Actual:", stdOut ] |
10 changes: 10 additions & 0 deletions
10
test/integration/tests/4101-dependency-tree/files/files.cabal
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,10 @@ | ||
name: files | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
library | ||
hs-source-dirs: src | ||
exposed-modules: Lib | ||
build-depends: base >= 4.7 && < 5, mtl | ||
default-language: Haskell2010 |
5 changes: 5 additions & 0 deletions
5
test/integration/tests/4101-dependency-tree/files/src/Main.hs
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,5 @@ | ||
module Main where | ||
|
||
main :: IO () | ||
main = do | ||
putStrLn "hello world" |
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,3 @@ | ||
resolver: lts-12.14 | ||
packages: | ||
- . |