Skip to content

Commit

Permalink
doc: be clear about Go special cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Dec 1, 2023
1 parent d677bce commit e0c9d76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository contains fixtures for standard IPLD codecs. It is used to verify

The [fixtures](./fixtures/) directory contains a suite of test data, where each subdirectory comprises an encoded IPLD block in the formats that are supported for that data. A file containing the binary encoded form of that block has the name `<CID>.<codec-name>`, where the `CID` is the CIDv1 using a SHA2-256 multihash of the block for that codec. The `codec-name` is the standard codec name as found in the [multicodec table](https://github.com/multiformats/multicodec/blob/master/table.csv).

Fixtures are also available in CAR format, in the [./fixtures.car](./fixtures.car) file, with every valid variation stored as a separate block.
Fixtures are also available in CAR format, in the [./fixtures.car](./fixtures.car) file, with every valid variation stored as a separate block. (Note that this file includes blocks that may not be readable on some systems, e.g. Kubo because of the currently [unsupported Go edge cases](./go/special_cases.go)).

Codec implementations are expected to be able to:

Expand Down
3 changes: 1 addition & 2 deletions go/codecs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ func testNegativeFixtureEncode(codecName string, fixture negativeFixtureEncode)
err = encoder(node, &buf)
if err == nil {
t.Errorf("should error on encode")
}
if !strings.EqualFold(err.Error(), fixture.Error) {
} else if !strings.EqualFold(err.Error(), fixture.Error) {
t.Logf("error mismatch: [%s] ~= [%s]", err.Error(), fixture.Error)
}
}
Expand Down
11 changes: 8 additions & 3 deletions go/special_cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ type FixtureName = string
type FixtureBlacklistReason = string

var FixtureBlacklist = map[FixtureName]FixtureBlacklistReason{
"int--11959030306112471732": "integer out of int64 range",
"int-11959030306112471731": "integer out of int64 range",
"int-18446744073709551615": "integer out of int64 range",
// negative integer outside of the int64 range, no support for that in Go
"int--11959030306112471732": "integer out of int64 range",
// dag-json strconv parsing error, out of int64 range
"int-11959030306112471731": "integer out of int64 range",
// dag-json strconv parsing error, out of int64 range
"int-18446744073709551615": "integer out of int64 range",
// dag-pb codec not strict on encoding unordered named link lists, should
// error but does not for these two:
"dag-pb/encode/bad sort": "pre-sort not required",
"dag-pb/encode/bad sort (incl length)": "pre-sort not required",
}

0 comments on commit e0c9d76

Please # to comment.