<commit_before>import Control.Monad (when)
import StackTest

main :: IO ()
main = do
  stackCheckStdout ["ls", "dependencies", "tree"] $ \stdOut -> do
    let expected = unlines [ "Packages"
                           , "├─┬ files 0.1.0.0"
                           , "│ ├─┬ base 4.10.1.0"
                           , "│ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ └── rts 1.0"
                           , "│ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │ │   └── rts 1.0"
                           , "│ │ └── rts 1.0"
                           , "│ ├─┬ filelock 0.1.1.2"
                           , "│ │ ├─┬ base 4.10.1.0"
                           , "│ │ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │ └── rts 1.0"
                           , "│ │ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │   └── rts 1.0"
                           , "│ │ │ └── rts 1.0"
                           , "│ │ └─┬ unix 2.7.2.2"
                           , "│ │   ├─┬ base 4.10.1.0"
                           , "│ │   │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ └── rts 1.0"
                           , "│ │   │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │   └── rts 1.0"
                           , "│ │   │ └── rts 1.0"
                           , "│ │   ├─┬ bytestring 0.10.8.2"
                           , "│ │   │ ├─┬ base 4.10.1.0"
                           , "│ │   │ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │ └── rts 1.0"
                           , "│ │   │ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │   └── rts 1.0"
                           , "│ │   │ │ └── rts 1.0"
                           , "│ │   │ ├─┬ deepseq 1.4.3.0"
                           , "│ │   │ │ ├─┬ array 0.5.2.0"
                           , "│ │   │ │ │ └─┬ base 4.10.1.0"
                           , "│ │   │ │ │   ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │   │ └── rts 1.0"
                           , "│ │   │ │ │   ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │ │   │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │   │   └── rts 1.0"
                           , "│ │   │ │ │   └── rts 1.0"
                           , "│ │   │ │ └─┬ base 4.10.1.0"
                           , "│ │   │ │   ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │   │ └── rts 1.0"
                           , "│ │   │ │   ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │   │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │   │   └── rts 1.0"
                           , "│ │   │ │   └── rts 1.0"
                           , "│ │   │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ └── rts 1.0"
                           , "│ │   │ └─┬ integer-gmp 1.0.1.0"
                           , "│ │   │   └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │     └── rts 1.0"
                           , "│ │   └─┬ time 1.8.0.2"
                           , "│ │     ├─┬ base 4.10.1.0"
                           , "│ │     │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │     │ │ └── rts 1.0"
                           , "│ │     │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │     │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │     │ │   └── rts 1.0"
                           , "│ │     │ └── rts 1.0"
                           , "│ │     └─┬ deepseq 1.4.3.0"
                           , "│ │       ├─┬ array 0.5.2.0"
                           , "│ │       │ └─┬ base 4.10.1.0"
                           , "│ │       │   ├─┬ ghc-prim 0.5.1.1"
                           , "│ │       │   │ └── rts 1.0"
                           , "│ │       │   ├─┬ integer-gmp 1.0.1.0"
                           , "│ │       │   │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │       │   │   └── rts 1.0"
                           , "│ │       │   └── rts 1.0"
                           , "│ │       └─┬ base 4.10.1.0"
                           , "│ │         ├─┬ ghc-prim 0.5.1.1"
                           , "│ │         │ └── rts 1.0"
                           , "│ │         ├─┬ integer-gmp 1.0.1.0"
                           , "│ │         │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │         │   └── rts 1.0"
                           , "│ │         └── rts 1.0"
                           , "│ ├─┬ mtl 2.2.2"
                           , "│ │ ├─┬ base 4.10.1.0"
                           , "│ │ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │ └── rts 1.0"
                           , "│ │ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │   └── rts 1.0"
                           , "│ │ │ └── rts 1.0"
                           , "│ │ └─┬ transformers 0.5.2.0"
                           , "│ │   └─┬ base 4.10.1.0"
                           , "│ │     ├─┬ ghc-prim 0.5.1.1"
                           , "│ │     │ └── rts 1.0"
                           , "│ │     ├─┬ integer-gmp 1.0.1.0"
                           , "│ │     │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │     │   └── rts 1.0"
                           , "│ │     └── rts 1.0"
                           , "│ └─┬ subproject 0.1.0.0"
                           , "│   └─┬ base 4.10.1.0"
                           , "│     ├─┬ ghc-prim 0.5.1.1"
                           , "│     │ └── rts 1.0"
                           , "│     ├─┬ integer-gmp 1.0.1.0"
                           , "│     │ └─┬ ghc-prim 0.5.1.1"
                           , "│     │   └── rts 1.0"
                           , "│     └── rts 1.0"
                           , "└─┬ subproject 0.1.0.0"
                           , "  └─┬ base 4.10.1.0"
                           , "    ├─┬ ghc-prim 0.5.1.1"
                           , "    │ └── rts 1.0"
                           , "    ├─┬ integer-gmp 1.0.1.0"
                           , "    │ └─┬ ghc-prim 0.5.1.1"
                           , "    │   └── rts 1.0"
                           , "    └── rts 1.0"
                           ]
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

  stackCheckStdout ["ls", "dependencies", "tree", "--depth=1"] $ \stdOut -> do
    let expected = unlines [ "Packages"
                           , "├─┬ files 0.1.0.0"
                           , "│ ├── base 4.10.1.0"
                           , "│ ├── filelock 0.1.1.2"
                           , "│ ├── mtl 2.2.2"
                           , "│ └── subproject 0.1.0.0"
                           , "└─┬ subproject 0.1.0.0"
                           , "  └── base 4.10.1.0"
                           ]
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

  stackCheckStdout ["ls", "dependencies", "tree", "subproject"] $ \stdOut -> do
    let expected = unlines [ "Packages"
                           , "└─┬ subproject 0.1.0.0"
                           , "  └─┬ base 4.10.1.0"
                           , "    ├─┬ ghc-prim 0.5.1.1"
                           , "    │ └── rts 1.0"
                           , "    ├─┬ integer-gmp 1.0.1.0"
                           , "    │ └─┬ ghc-prim 0.5.1.1"
                           , "    │   └── rts 1.0"
                           , "    └── rts 1.0"
                           ]
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

  stackCheckStdout ["ls", "dependencies", "json"] $ \stdOut -> do
    dir <- testDir
    let expected = "[{\"dependencies\":[\"base\",\"bytestring\",\"time\"],\"name\":\"unix\",\"version\":\"2.7.2.2\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\"],\"name\":\"transformers\",\"version\":\"0.5.2.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\",\"deepseq\"],\"name\":\"time\",\"version\":\"1.8.0.2\",\"license\":\"BSD3\"},{\"location\":{\"url\":\"file://" ++ dir ++ "/files/subproject/\",\"type\":\"project package\"},\"dependencies\":[\"base\"],\"name\":\"subproject\",\"version\":\"0.1.0.0\",\"license\":\"AllRightsReserved\"},{\"dependencies\":[],\"name\":\"rts\",\"version\":\"1.0\",\"license\":\"BSD3\"},{\"location\":{\"url\":\"https://hackage.haskell.org/package/mtl-2.2.2\",\"type\":\"hackage\"},\"dependencies\":[\"base\",\"transformers\"],\"name\":\"mtl\",\"version\":\"2.2.2\",\"license\":\"BSD3\"},{\"dependencies\":[\"ghc-prim\"],\"name\":\"integer-gmp\",\"version\":\"1.0.1.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"rts\"],\"name\":\"ghc-prim\",\"version\":\"0.5.1.1\",\"license\":\"BSD3\"},{\"location\":{\"url\":\"file://" ++ dir ++ "/files/\",\"type\":\"project package\"},\"dependencies\":[\"base\",\"filelock\",\"mtl\",\"subproject\"],\"name\":\"files\",\"version\":\"0.1.0.0\",\"license\":\"AllRightsReserved\"},{\"location\":{\"subdir\":\"\",\"url\":\"<EMAIL>:snoyberg/filelock\",\"type\":\"git\",\"commit\":\"4f080496d8bf153fbe26e64d1f52cf73c7db25f6\"},\"dependencies\":[\"base\",\"unix\"],\"name\":\"filelock\",\"version\":\"0.1.1.2\",\"license\":\"PublicDomain\"},{\"dependencies\":[\"array\",\"base\"],\"name\":\"deepseq\",\"version\":\"1.4.3.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\",\"deepseq\",\"ghc-prim\",\"integer-gmp\"],\"name\":\"bytestring\",\"version\":\"0.10.8.2\",\"license\":\"BSD3\"},{\"dependencies\":[\"ghc-prim\",\"integer-gmp\",\"rts\"],\"name\":\"base\",\"version\":\"4.10.1.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\"],\"name\":\"array\",\"version\":\"0.5.2.0\",\"license\":\"BSD3\"}]\n"
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]
<commit_msg>Fix expected output for a test<commit_after>import Control.Monad (when)
import StackTest

main :: IO ()
main = do
  stackCheckStdout ["ls", "dependencies", "tree"] $ \stdOut -> do
    let expected = unlines [ "Packages"
                           , "├─┬ files 0.1.0.0"
                           , "│ ├─┬ base 4.10.1.0"
                           , "│ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ └── rts 1.0"
                           , "│ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │ │   └── rts 1.0"
                           , "│ │ └── rts 1.0"
                           , "│ ├─┬ filelock 0.1.1.2"
                           , "│ │ ├─┬ base 4.10.1.0"
                           , "│ │ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │ └── rts 1.0"
                           , "│ │ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │   └── rts 1.0"
                           , "│ │ │ └── rts 1.0"
                           , "│ │ └─┬ unix 2.7.2.2"
                           , "│ │   ├─┬ base 4.10.1.0"
                           , "│ │   │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ └── rts 1.0"
                           , "│ │   │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │   └── rts 1.0"
                           , "│ │   │ └── rts 1.0"
                           , "│ │   ├─┬ bytestring 0.10.8.2"
                           , "│ │   │ ├─┬ base 4.10.1.0"
                           , "│ │   │ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │ └── rts 1.0"
                           , "│ │   │ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │   └── rts 1.0"
                           , "│ │   │ │ └── rts 1.0"
                           , "│ │   │ ├─┬ deepseq 1.4.3.0"
                           , "│ │   │ │ ├─┬ array 0.5.2.0"
                           , "│ │   │ │ │ └─┬ base 4.10.1.0"
                           , "│ │   │ │ │   ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │   │ └── rts 1.0"
                           , "│ │   │ │ │   ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │ │   │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ │   │   └── rts 1.0"
                           , "│ │   │ │ │   └── rts 1.0"
                           , "│ │   │ │ └─┬ base 4.10.1.0"
                           , "│ │   │ │   ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │   │ └── rts 1.0"
                           , "│ │   │ │   ├─┬ integer-gmp 1.0.1.0"
                           , "│ │   │ │   │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │   │   └── rts 1.0"
                           , "│ │   │ │   └── rts 1.0"
                           , "│ │   │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │   │ │ └── rts 1.0"
                           , "│ │   │ └─┬ integer-gmp 1.0.1.0"
                           , "│ │   │   └─┬ ghc-prim 0.5.1.1"
                           , "│ │   │     └── rts 1.0"
                           , "│ │   └─┬ time 1.8.0.2"
                           , "│ │     ├─┬ base 4.10.1.0"
                           , "│ │     │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │     │ │ └── rts 1.0"
                           , "│ │     │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │     │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │     │ │   └── rts 1.0"
                           , "│ │     │ └── rts 1.0"
                           , "│ │     └─┬ deepseq 1.4.3.0"
                           , "│ │       ├─┬ array 0.5.2.0"
                           , "│ │       │ └─┬ base 4.10.1.0"
                           , "│ │       │   ├─┬ ghc-prim 0.5.1.1"
                           , "│ │       │   │ └── rts 1.0"
                           , "│ │       │   ├─┬ integer-gmp 1.0.1.0"
                           , "│ │       │   │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │       │   │   └── rts 1.0"
                           , "│ │       │   └── rts 1.0"
                           , "│ │       └─┬ base 4.10.1.0"
                           , "│ │         ├─┬ ghc-prim 0.5.1.1"
                           , "│ │         │ └── rts 1.0"
                           , "│ │         ├─┬ integer-gmp 1.0.1.0"
                           , "│ │         │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │         │   └── rts 1.0"
                           , "│ │         └── rts 1.0"
                           , "│ ├─┬ mtl 2.2.2"
                           , "│ │ ├─┬ base 4.10.1.0"
                           , "│ │ │ ├─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │ └── rts 1.0"
                           , "│ │ │ ├─┬ integer-gmp 1.0.1.0"
                           , "│ │ │ │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │ │ │   └── rts 1.0"
                           , "│ │ │ └── rts 1.0"
                           , "│ │ └─┬ transformers 0.5.2.0"
                           , "│ │   └─┬ base 4.10.1.0"
                           , "│ │     ├─┬ ghc-prim 0.5.1.1"
                           , "│ │     │ └── rts 1.0"
                           , "│ │     ├─┬ integer-gmp 1.0.1.0"
                           , "│ │     │ └─┬ ghc-prim 0.5.1.1"
                           , "│ │     │   └── rts 1.0"
                           , "│ │     └── rts 1.0"
                           , "│ └─┬ subproject 0.1.0.0"
                           , "│   └─┬ base 4.10.1.0"
                           , "│     ├─┬ ghc-prim 0.5.1.1"
                           , "│     │ └── rts 1.0"
                           , "│     ├─┬ integer-gmp 1.0.1.0"
                           , "│     │ └─┬ ghc-prim 0.5.1.1"
                           , "│     │   └── rts 1.0"
                           , "│     └── rts 1.0"
                           , "└─┬ subproject 0.1.0.0"
                           , "  └─┬ base 4.10.1.0"
                           , "    ├─┬ ghc-prim 0.5.1.1"
                           , "    │ └── rts 1.0"
                           , "    ├─┬ integer-gmp 1.0.1.0"
                           , "    │ └─┬ ghc-prim 0.5.1.1"
                           , "    │   └── rts 1.0"
                           , "    └── rts 1.0"
                           ]
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

  stackCheckStdout ["ls", "dependencies", "tree", "--depth=1"] $ \stdOut -> do
    let expected = unlines [ "Packages"
                           , "├─┬ files 0.1.0.0"
                           , "│ ├── base 4.10.1.0"
                           , "│ ├── filelock 0.1.1.2"
                           , "│ ├── mtl 2.2.2"
                           , "│ └── subproject 0.1.0.0"
                           , "└─┬ subproject 0.1.0.0"
                           , "  └── base 4.10.1.0"
                           ]
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

  stackCheckStdout ["ls", "dependencies", "tree", "subproject"] $ \stdOut -> do
    let expected = unlines [ "Packages"
                           , "└─┬ subproject 0.1.0.0"
                           , "  └─┬ base 4.10.1.0"
                           , "    ├─┬ ghc-prim 0.5.1.1"
                           , "    │ └── rts 1.0"
                           , "    ├─┬ integer-gmp 1.0.1.0"
                           , "    │ └─┬ ghc-prim 0.5.1.1"
                           , "    │   └── rts 1.0"
                           , "    └── rts 1.0"
                           ]
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

  stackCheckStdout ["ls", "dependencies", "json"] $ \stdOut -> do
    dir <- testDir
    let expected = "[{\"dependencies\":[\"base\",\"bytestring\",\"time\"],\"name\":\"unix\",\"version\":\"2.7.2.2\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\"],\"name\":\"transformers\",\"version\":\"0.5.2.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\",\"deepseq\"],\"name\":\"time\",\"version\":\"1.8.0.2\",\"license\":\"BSD3\"},{\"location\":{\"url\":\"file://" ++ dir ++ "/files/subproject/\",\"type\":\"project package\"},\"dependencies\":[\"base\"],\"name\":\"subproject\",\"version\":\"0.1.0.0\",\"license\":\"AllRightsReserved\"},{\"dependencies\":[],\"name\":\"rts\",\"version\":\"1.0\",\"license\":\"BSD3\"},{\"location\":{\"url\":\"https://hackage.haskell.org/package/mtl-2.2.2\",\"type\":\"hackage\"},\"dependencies\":[\"base\",\"transformers\"],\"name\":\"mtl\",\"version\":\"2.2.2\",\"license\":\"BSD3\"},{\"dependencies\":[\"ghc-prim\"],\"name\":\"integer-gmp\",\"version\":\"1.0.1.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"rts\"],\"name\":\"ghc-prim\",\"version\":\"0.5.1.1\",\"license\":\"BSD3\"},{\"location\":{\"url\":\"file://" ++ dir ++ "/files/\",\"type\":\"project package\"},\"dependencies\":[\"base\",\"filelock\",\"mtl\",\"subproject\"],\"name\":\"files\",\"version\":\"0.1.0.0\",\"license\":\"AllRightsReserved\"},{\"location\":{\"url\":\"https://github.com/snoyberg/filelock/archive/4f080496d8bf153fbe26e64d1f52cf73c7db25f6.tar.gz\",\"type\":\"archive\"},\"dependencies\":[\"base\",\"unix\"],\"name\":\"filelock\",\"version\":\"0.1.1.2\",\"license\":\"PublicDomain\"},{\"dependencies\":[\"array\",\"base\"],\"name\":\"deepseq\",\"version\":\"1.4.3.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\",\"deepseq\",\"ghc-prim\",\"integer-gmp\"],\"name\":\"bytestring\",\"version\":\"0.10.8.2\",\"license\":\"BSD3\"},{\"dependencies\":[\"ghc-prim\",\"integer-gmp\",\"rts\"],\"name\":\"base\",\"version\":\"4.10.1.0\",\"license\":\"BSD3\"},{\"dependencies\":[\"base\"],\"name\":\"array\",\"version\":\"0.5.2.0\",\"license\":\"BSD3\"}]\n"
    when (stdOut /= expected) $
      error $ unlines [ "Expected:", expected, "Actual:", stdOut ]

{'fraction_non_alphanumeric': 0.24306866739540892, 'fraction_numerical': 0.05137632912650303, 'mean_word_length': 0.8119373424558877, 'pattern_counts': {'":': 138, '<': 6, '<?xml version=': 0, '>': 12, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 180, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 106, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2363138', 'n_tokens_mistral': 7912, 'n_tokens_neox': 7859, 'n_words': 1583}