File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
test/Test/Codec/CBOR/Cuddle/CDDL Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ test-suite cuddle-test
137137 import : warnings
138138 default-language : GHC2021
139139 other-modules :
140+ Paths_cuddle
140141 Test.Codec.CBOR.Cuddle.CDDL.Examples
141142 Test.Codec.CBOR.Cuddle.CDDL.Gen
142143 Test.Codec.CBOR.Cuddle.CDDL.Parser
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