Skip to content

Commit

Permalink
Rename to libraries in expectations, sol#483.
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Mar 16, 2022
1 parent c5f3e77 commit 4dc129a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Changes in 0.35.0
- New section: `libraries`, replacing `internal-libraries` (a breaking change).

## Changes in 0.34.6
- Add `Paths_` module to `autogen-modules` when `cabal-version >= 2`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ library:
| `custom-setup` | · | | See [Custom setup](#custom-setup) | | |
| `flags` | `flag <name>` | | Map from flag name to flag (see [Flags](#flags)) | | |
| `library` | · | | See [Library fields](#library-fields) | | |
| `internal-libraries` | `library <name>` | | Map from internal library name to a dict of [library fields](#library-fields) and global top-level fields. | | `0.21.0` |
| `libraries` | `library <name>` | | Map from internal library name to a dict of [library fields](#library-fields) and global top-level fields. | | `0.21.0` |
| `executables` | `executable <name>` | | Map from executable name to executable (see [Executable fields](#executable-fields)) | | |
| `executable` | `executable <package-name>` | | Shortcut for `executables: { package-name: ... }` | | `0.18.0` |
| `tests` | `test-suite <name>` | | Map from test name to test (see [Test fields](#test-fields)) | | |
Expand Down
14 changes: 7 additions & 7 deletions test/EndToEndSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1075,11 +1075,11 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
foo (Blah as Etc)
|]) {packageCabalVersion = "2.0"}

describe "internal-libraries" $ do
it "accepts internal-libraries" $ do
describe "libraries" $ do
it "accepts libraries" $ do
touch "src/Foo.hs"
[i|
internal-libraries:
libraries:
bar:
source-dirs: src
|] `shouldRenderTo` namedLibrary "bar" [i|
Expand All @@ -1096,22 +1096,22 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
it "warns on unknown fields" $ do
[i|
name: foo
internal-libraries:
libraries:
bar:
baz: 42
|] `shouldWarn` pure "package.yaml: Ignoring unrecognized field $.internal-libraries.bar.baz"
|] `shouldWarn` pure "package.yaml: Ignoring unrecognized field $.libraries.bar.baz"

it "warns on missing source-dirs" $ do
[i|
name: foo
internal-libraries:
libraries:
bar:
source-dirs: src
|] `shouldWarn` pure "Specified source-dir \"src\" does not exist"

it "accepts visibility" $ do
[i|
internal-libraries:
libraries:
bar:
visibility: public
|] `shouldRenderTo` (namedLibrary "bar" [i|
Expand Down

0 comments on commit 4dc129a

Please sign in to comment.