File tree Expand file tree Collapse file tree 4 files changed +16
-13
lines changed
test/Test/Codec/CBOR/Cuddle/CDDL Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 22
33Cuddle is a library for generating and manipulating [ CDDL] ( https://datatracker.ietf.org/doc/html/rfc8610 ) .
44
5- <p align =" center " >
6- <a href =" https://github.com/input-output-hk/cuddle/actions/workflows/ci.yml " >
7- <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" />
8- </a >
9- </p >
5+ | Language | Github Actions | Coveralls |
6+ | :--------:| :--------------:| :---------:|
7+ | ![ 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 )
8+
9+ | Github Repo | Hackage | Nightly | LTS |
10+ | :-------------------| :-------:| :-------:| :---:|
11+ | [ ` 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 )
1012
1113## Supported features
1214
Original file line number Diff line number Diff line change 11cabal-version : 3.4
22name : cuddle
3- version : 1.0 .0.0
3+ version : 1.1 .0.0
44synopsis : CDDL Generator and test utilities
55description :
66 Cuddle is a library for generating and manipulating [CDDL](https://datatracker.ietf.org/doc/html/rfc8610).
@@ -22,16 +22,14 @@ category: Codec
2222build-type : Simple
2323extra-doc-files : CHANGELOG.md
2424tested-with : ghc == 9.6 || == 9.8 || == 9.10 || == 9.12
25+ data-files :
26+ example/cddl-files/*.cddl
27+ example/cddl-files/validator/negative/*.cddl
2528
2629source-repository head
2730 type : git
2831 location : https://github.com/input-output-hk/cuddle
2932
30- source-repository this
31- type : git
32- location : https://github.com/input-output-hk/cuddle
33- tag : cuddle-0.5.0.0
34-
3533flag example
3634 description : Enable the example executable
3735 manual : True
@@ -134,6 +132,7 @@ test-suite cuddle-test
134132 import : warnings
135133 default-language : GHC2021
136134 other-modules :
135+ Paths_cuddle
137136 Test.Codec.CBOR.Cuddle.CDDL.Examples
138137 Test.Codec.CBOR.Cuddle.CDDL.Gen
139138 Test.Codec.CBOR.Cuddle.CDDL.Parser
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ system-ghc: true
33packages :
44- .
55extra-deps :
6- - capability-0.5.0.1@sha256:3b3fa095891573bbdff854bf8351c3fcfa986d502c8071a2e4a2686ff3819302 ,3287
6+ - capability-0.5.0.1@sha256:fa45f434f7c908fc98311306c26d2d9286a244193b6dd4e97a4e228a9f6119bf ,3287
77- data-default-class-0.2.0.0@sha256:788dc5c0be3981ca83ad11206e300a77ae8a1c8b9bc4f9630f563d37f540ccbd,728
88- data-default-0.8.0.1@sha256:536ff91641a39b8ad302eebceff767d86ec6b543b44b1db9104650a2b1bc63bd,1110
Original file line number Diff line number Diff line change @@ -13,14 +13,16 @@ import Codec.CBOR.Cuddle.CDDL.Resolve (
1313 )
1414import Codec.CBOR.Cuddle.Parser (pCDDL )
1515import Data.Text.IO qualified as T
16+ import Paths_cuddle (getDataFileName )
1617import Test.HUnit (assertFailure )
1718import Test.Hspec
1819import Text.Megaparsec (parse )
1920import Text.Megaparsec.Error (errorBundlePretty )
2021
2122tryValidateFile :: FilePath -> IO (Either NameResolutionFailure (CTreeRoot MonoReferenced ))
2223tryValidateFile filePath = do
23- contents <- T. readFile filePath
24+ absoluteFilePath <- getDataFileName filePath
25+ contents <- T. readFile absoluteFilePath
2426 cddl <- case parse pCDDL " " contents of
2527 Right x -> pure $ prependPrelude x
2628 Left x -> fail $ " Failed to parse the file:\n " <> errorBundlePretty x
You can’t perform that action at this time.
0 commit comments