The test web bundle have generated only contains deterministic CBOR. This test is to make sure that we don't accidentally break our deterministic checker. It contains a lot of nested CBOR types so it might catch something that has not been covered with other tests.
(t *testing.T)
| 289 | // sure that we don't accidentally break our deterministic checker. It contains a lot of |
| 290 | // nested CBOR types so it might catch something that has not been covered with other tests. |
| 291 | func TestWebBundleHasDeterministicCbor(t *testing.T) { |
| 292 | bundleFile, err := os.Open("../../integrityblock/testfile.wbn") |
| 293 | if err != nil { |
| 294 | t.Error("Failed to open the test file") |
| 295 | } |
| 296 | defer bundleFile.Close() |
| 297 | bundleBytes, err := ioutil.ReadAll(bundleFile) |
| 298 | if err != nil { |
| 299 | t.Error("Failed to read the test file") |
| 300 | } |
| 301 | |
| 302 | if err := Deterministic(bundleBytes); err != nil { |
| 303 | t.Error("testfile.wbn only contains deterministic CBOR and this shouldn't fail.") |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | // Helper functions: |
| 308 |
nothing calls this directly
no test coverage detected