Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
"test-dir" [] are the mock calls to `getPackageDir` and `listDirectory`
  • Loading branch information
ffaf1 committed Jul 29, 2023
1 parent cca7fe6 commit fc3cff8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,22 +372,22 @@ pkgArgs =

testProjArgs :: String -> NonEmpty String
testProjArgs comments =
fromList ["4", "n", "foo-package"]
fromList ["4", "test-dir", "[]", "foo-package"]
<> pkgArgs
<> fromList (NEL.drop 1 testArgs)
<> fromList [comments]

libProjArgs :: String -> NonEmpty String
libProjArgs comments =
fromList ["1", "n", "foo-package"]
fromList ["1", "test-dir", "[]", "foo-package"]
<> pkgArgs
<> libArgs
<> testArgs
<> fromList [comments]

fullProjArgs :: String -> NonEmpty String
fullProjArgs comments =
fromList ["3", "n", "foo-package"]
fromList ["3", "test-dir", "[]", "foo-package"]
<> pkgArgs
<> libArgs
<> exeArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ createProjectTest pkgIx srcDb =
, dependencies = Flag []
}

case (_runPrompt $ createProject silent pkgIx srcDb dummyFlags') (fromList ["n", "3", "quxTest/Main.hs"]) of
case (_runPrompt $ createProject silent pkgIx srcDb dummyFlags') (fromList ["[]", "3", "quxTest/Main.hs"]) of
Right (ProjectSettings opts desc (Just lib) (Just exe) (Just test), _) -> do
_optOverwrite opts @?= False
_optMinimal opts @?= False
Expand Down Expand Up @@ -134,8 +134,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "3"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down Expand Up @@ -240,8 +241,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "1"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down Expand Up @@ -331,8 +333,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "4"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down Expand Up @@ -411,8 +414,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "3"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down Expand Up @@ -503,8 +507,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "1"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down Expand Up @@ -580,8 +585,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "1"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down Expand Up @@ -664,8 +670,9 @@ createProjectTest pkgIx srcDb =
fromList
-- package type
[ "2"
, -- overwrite
"n"
, -- overwrite (not asked, pristine folder)
"test-package-dir"
, "[]"
, -- package dir
"test-package"
, -- package description
Expand Down

0 comments on commit fc3cff8

Please sign in to comment.