-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
206a54a
commit 6dd178f
Showing
8 changed files
with
76 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# checking repl command with a project using an implicit default 'cabal.project' | ||
# cabal repl | ||
Configuration is affected by the following files: | ||
- cabal.project | ||
Error: [Cabal-7076] | ||
With a project, the REPL command requires a single target. The packages in this project are: | ||
- pkg-one | ||
- pkg-two | ||
# checking repl command with a project using an explicit 'cabal.project' | ||
# cabal repl | ||
Configuration is affected by the following files: | ||
- some.project | ||
Error: [Cabal-7076] | ||
With a project, the REPL command requires a single target. The packages in this project, 'some.project', are: | ||
- pkg-one | ||
- pkg-two | ||
# checking repl command with a project listing packages in reverse order | ||
# cabal repl | ||
Configuration is affected by the following files: | ||
- reverse.project | ||
Error: [Cabal-7076] | ||
With a project, the REPL command requires a single target. The packages in this project, 'reverse.project', are: | ||
- pkg-one | ||
- pkg-two | ||
# checking repl command with a project with no packages | ||
# cabal repl | ||
Configuration is affected by the following files: | ||
- empty.project | ||
Warning: There are no packages or optional-packages in the project | ||
Error: [Cabal-7076] | ||
With a project, the REPL command requires a single target but there are no packages in this project, 'empty.project', to choose a package (library) or other component from as the target for this command. | ||
# checking repl command with a missing project | ||
# cabal repl |
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 @@ | ||
packages: pkg-one pkg-two |
22 changes: 22 additions & 0 deletions
22
cabal-testsuite/PackageTests/ReplProjectTarget/cabal.test.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,22 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest . recordMode RecordMarked $ do | ||
let log = recordHeader . pure | ||
|
||
log "checking repl command with a project using an implicit default 'cabal.project'" | ||
_ <- fails $ cabal' "repl" [] | ||
|
||
log "checking repl command with a project using an explicit 'cabal.project'" | ||
_ <- fails $ cabal' "repl" [ "--project-file=some.project" ] | ||
|
||
log "checking repl command with a project listing packages in reverse order" | ||
_ <- fails $ cabal' "repl" [ "--project-file=reverse.project" ] | ||
|
||
log "checking repl command with a project with no packages" | ||
_ <- fails $ cabal' "repl" [ "--project-file=empty.project" ] | ||
|
||
log "checking repl command with a missing project" | ||
missing <- fails $ cabal' "repl" [ "--project-file=missing.project" ] | ||
assertOutputContains "The given project file 'missing.project' does not exist." missing | ||
|
||
return () |
Empty file.
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/ReplProjectTarget/pkg-one/pkg-one.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,9 @@ | ||
name: pkg-one | ||
version: 0.1 | ||
license: BSD3 | ||
cabal-version: >= 1.2 | ||
build-type: Simple | ||
|
||
library | ||
exposed-modules: Foo | ||
build-depends: base |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/ReplProjectTarget/pkg-two/pkg-one.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,9 @@ | ||
name: pkg-one | ||
version: 0.1 | ||
license: BSD3 | ||
cabal-version: >= 1.2 | ||
build-type: Simple | ||
|
||
library | ||
exposed-modules: Foo | ||
build-depends: base |
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 @@ | ||
packages: pkg-two pkg-one |
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 @@ | ||
packages: pkg-one pkg-two |