Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

Cuddle is a library for generating and manipulating [CDDL](https://datatracker.ietf.org/doc/html/rfc8610).

<p align="center">
<a href="https://github.com/input-output-hk/cuddle/actions/workflows/ci.yml">
<img alt="GitHub Workflow Status (master)" src="https://img.shields.io/github/actions/workflow/status/input-output-hk/cuddle/ci.yml?branch=master&style=for-the-badge" />
</a>
</p>
| Language | Github Actions | Coveralls |
|:--------:|:--------------:|:---------:|
| ![GitHub top language](https://img.shields.io/github/languages/top/input-output-hk/cuddle.svg) | [![Build Status](https://github.com/input-output-hk/cuddle/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/input-output-hk/cuddle/actions/workflows/ci.yaml) | [![Coverage Status](https://coveralls.io/repos/github/input-output-hk/cuddle/badge.svg?branch=master)](https://coveralls.io/github/input-output-hk/cuddle?branch=master)

| Github Repo | Hackage | Nightly | LTS |
|:-------------------|:-------:|:-------:|:---:|
| [`cuddle`](https://github.com/input-output-hk/cuddle)| [![Hackage](https://img.shields.io/hackage/v/cuddle.svg)](https://hackage.haskell.org/package/cuddle)| [![Nightly](https://www.stackage.org/package/cuddle/badge/nightly)](https://www.stackage.org/nightly/package/cuddle)| [![LTS](https://www.stackage.org/package/cuddle/badge/lts)](https://www.stackage.org/lts/package/cuddle)

## Supported features

Expand Down
11 changes: 5 additions & 6 deletions cuddle.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.4
name: cuddle
version: 1.0.0.0
version: 1.1.0.0
synopsis: CDDL Generator and test utilities
description:
Cuddle is a library for generating and manipulating [CDDL](https://datatracker.ietf.org/doc/html/rfc8610).
Expand All @@ -22,16 +22,14 @@ category: Codec
build-type: Simple
extra-doc-files: CHANGELOG.md
tested-with: ghc ==9.6 || ==9.8 || ==9.10 || ==9.12
data-files:
example/cddl-files/*.cddl
example/cddl-files/validator/negative/*.cddl

source-repository head
type: git
location: https://github.com/input-output-hk/cuddle

source-repository this
type: git
location: https://github.com/input-output-hk/cuddle
tag: cuddle-0.5.0.0

flag example
description: Enable the example executable
manual: True
Expand Down Expand Up @@ -134,6 +132,7 @@ test-suite cuddle-test
import: warnings
default-language: GHC2021
other-modules:
Paths_cuddle
Test.Codec.CBOR.Cuddle.CDDL.Examples
Test.Codec.CBOR.Cuddle.CDDL.Gen
Test.Codec.CBOR.Cuddle.CDDL.Parser
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ system-ghc: true
packages:
- .
extra-deps:
- capability-0.5.0.1@sha256:3b3fa095891573bbdff854bf8351c3fcfa986d502c8071a2e4a2686ff3819302,3287
- capability-0.5.0.1@sha256:fa45f434f7c908fc98311306c26d2d9286a244193b6dd4e97a4e228a9f6119bf,3287
- data-default-class-0.2.0.0@sha256:788dc5c0be3981ca83ad11206e300a77ae8a1c8b9bc4f9630f563d37f540ccbd,728
- data-default-0.8.0.1@sha256:536ff91641a39b8ad302eebceff767d86ec6b543b44b1db9104650a2b1bc63bd,1110
4 changes: 3 additions & 1 deletion test/Test/Codec/CBOR/Cuddle/CDDL/Examples.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ import Codec.CBOR.Cuddle.CDDL.Resolve (
)
import Codec.CBOR.Cuddle.Parser (pCDDL)
import Data.Text.IO qualified as T
import Paths_cuddle (getDataFileName)
import Test.HUnit (assertFailure)
import Test.Hspec
import Text.Megaparsec (parse)
import Text.Megaparsec.Error (errorBundlePretty)

tryValidateFile :: FilePath -> IO (Either NameResolutionFailure (CTreeRoot MonoReferenced))
tryValidateFile filePath = do
contents <- T.readFile filePath
absoluteFilePath <- getDataFileName filePath
contents <- T.readFile absoluteFilePath
cddl <- case parse pCDDL "" contents of
Right x -> pure $ prependPrelude x
Left x -> fail $ "Failed to parse the file:\n" <> errorBundlePretty x
Expand Down