Switch manifest serialization to CBOR
Replace JSON-based bundle manifest with a CBOR-encoded format. The manifest is now a canonical CBOR map with order-strict key decoding, raw 32-byte hash payloads (instead of hex-encoded JSON), and compact binary representation.
This commit is contained in:
20
test/Spec.hs
20
test/Spec.hs
@@ -2041,7 +2041,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= okT Leaf (bytesT ([101,102,103] ++ nodesBytes))
|
||||
|
||||
, testCase "readArborixNodesSection: reads id fixture bundle" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/id.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/id.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right _ -> do
|
||||
@@ -2053,7 +2053,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 0
|
||||
|
||||
, testCase "readArborixNodesSection: reads notQ fixture bundle" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right _ -> do
|
||||
@@ -2065,7 +2065,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 0
|
||||
|
||||
, testCase "readArborixNodesSection: reads map fixture bundle" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/map.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/map.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right _ -> do
|
||||
@@ -2077,7 +2077,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 0
|
||||
|
||||
, testCase "readArborixExecutableFromHash: reconstructs id fixture root" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/id.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/id.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
@@ -2093,7 +2093,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 0
|
||||
|
||||
, testCase "readArborixExecutableFromHash: reconstructs notQ fixture root" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
@@ -2109,7 +2109,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 0
|
||||
|
||||
, testCase "readArborixExecutableFromHash: reconstructs map fixture root" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/map.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/map.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
@@ -2125,7 +2125,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 0
|
||||
|
||||
, testCase "readArborixExecutableFromHash: executes id fixture root" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/id.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/id.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
@@ -2141,7 +2141,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= ofNumber 42
|
||||
|
||||
, testCase "readArborixExecutableFromHash: executes notQ fixture on true" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
@@ -2157,7 +2157,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= falseT
|
||||
|
||||
, testCase "readArborixExecutableFromHash: executes notQ fixture on false" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/notQ.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
@@ -2173,7 +2173,7 @@ binaryReaderTests = testGroup "Binary Reader Tests"
|
||||
result env @?= trueT
|
||||
|
||||
, testCase "readArborixExecutableFromHash: executes map fixture root" $ do
|
||||
fixtureBytes <- BS.readFile "test/fixtures/map.tri.bundle"
|
||||
fixtureBytes <- BS.readFile "test/fixtures/map.arborix"
|
||||
case decodeBundle fixtureBytes of
|
||||
Left err -> assertFailure $ "decodeBundle failed: " ++ err
|
||||
Right bundle -> case bundleRoots bundle of
|
||||
|
||||
BIN
test/fixtures/false.arborix
vendored
Normal file
BIN
test/fixtures/false.arborix
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/id.arborix
vendored
Normal file
BIN
test/fixtures/id.arborix
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/id.tri.bundle
vendored
BIN
test/fixtures/id.tri.bundle
vendored
Binary file not shown.
BIN
test/fixtures/map.arborix
vendored
Normal file
BIN
test/fixtures/map.arborix
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/map.tri.bundle
vendored
BIN
test/fixtures/map.tri.bundle
vendored
Binary file not shown.
BIN
test/fixtures/notQ.arborix
vendored
Normal file
BIN
test/fixtures/notQ.arborix
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/notQ.tri.bundle
vendored
BIN
test/fixtures/notQ.tri.bundle
vendored
Binary file not shown.
BIN
test/fixtures/true.arborix
vendored
Normal file
BIN
test/fixtures/true.arborix
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user