- 20 Oct, 2020 6 commits
-
-
Eric Myhre authored
This requires introducing an error-carrying NodeAssembler, because the AssembleValue methods don't have the ability to return errors themselves. AssembleValue methods have not needed to return errors before! Most lists don't have any reason to error: out of our whole system, it's only struct-with-tuple-representation that can have errors here, due to tuples having length limits. AssembleValue for maps doesn't have a similar challenge either, because key invalidity can always be indicated by errors returned from the key assembly process. I'm not a big fan of this diff -- error carrying thunks like this are ugly to write and they're also pretty ugly to use -- but I'm not sure what would be better. ListAssembler.AssembleValue returning an error? Turning ListAssembler into a two phase thing, e.g. with an Advance method that fills some of the same role as AssembleKey does for maps, and gives us a place to return errors?
-
Eric Myhre authored
I don't think we've resolved the questions already noted in that diff yet, and I abhor drifting open branches, so I'm going to "merge" this such that it's in git history for reference, but not an effected diff. Additionally, I believe we encountered a question about whether this string should include multibase -- this diff doesn't; the spec suggested it should; and I think we've agreed the spec should be changed, but I'm not sure if that's been done yet. At any rate, someone's welcome to take a look at this again in the future.
-
Eric Myhre authored
I haven't implemented the reader side because I'm not sure it's possible; the specification is insufficiently clear. I opened Issue https://github.com/ipld/specs/issues/302 to track this.
-
Eric Myhre authored
-
Eric Myhre authored
-
Eric Myhre authored
Implement resource budgets in dagcbor parsing.
-
- 15 Oct, 2020 1 commit
-
-
Eric Myhre authored
Codegen for links should emit the methods to conform to the schema.TypedLinkNode interface where applicable.
-
- 04 Oct, 2020 1 commit
-
-
Eric Myhre authored
Codegen for links should emit the methods to conform to the schema.TypedLinkNode interface where applicable. Should fix https://github.com/ipld/go-ipld-prime/issues/90 .
-
- 01 Oct, 2020 3 commits
-
-
Eric Myhre authored
Introduce fluent.Reflect convenience functions.
-
Eric Myhre authored
-
Eric Myhre authored
-
- 28 Sep, 2020 1 commit
-
-
Eric Myhre authored
-
- 24 Sep, 2020 1 commit
-
-
Eric Myhre authored
-
- 10 Sep, 2020 11 commits
-
-
Daniel Martí authored
They do quite a lot of work, including setting up a type system, generating Go code, and building it. This package is by far the slowest to test. On a warm cache, 'go test -count=1 ./...' shows all packages under 0.2s, while this one sits at ~1.5s. 1.5s is not unreasonable with a warm cache, but we can bring that down to 0.6s on my quad-core laptop by just making all tests parallel. Note that sub-tests aren't parallel for now, since there are multiple layers of them and I'm not sure I even follow what's going on. Mac is also disabled for the time being, since it seems to time out too often.
-
Daniel Martí authored
Buffers are not a good option for tests if the other side expects a reader. Otherwise, the code being tested could build assumptions around the reader stream being a single contiguous chunk of bytes, such as: _ = r.(*bytes.Buffer).Bytes() This kind of hack might seem unlikely, but it's an easy mistake to make, especially with APIs like fmt which automatically call String methods. With bytes.Reader and strings.Reader, the types are much more restricted, so the tests need to be more faithful.
-
Bryan White authored
-
Eric Myhre authored
schema-schema codegen demo now includes unmarshal exercise
-
Eric Myhre authored
-
Eric Myhre authored
-
Eric Myhre authored
-
Eric Myhre authored
Align several more bits of schema-schema json with the drifts made by the programatic type construction. The gap between these isn't within the reach of this test to probe. (Yet. We'll get there. It's not terribly much further.)
-
Eric Myhre authored
This is a somewhat altered schema-schema document, as commented. Some of those alterations might get upstreamed; I'll be making other PRs to the upstream specs repo to discuss that.
-
Eric Myhre authored
- it now uses kinded unions (since those are supported now; they weren't yet the last time we touched this demo!). - a few typos are fixed (field names; in one case, a place that must support type names as well as inline defns). - added the 'Schema' type at the very top! this is what parsing the schema-schema starts with!
-
Eric Myhre authored
Update tests for unions; several fixes
-
- 05 Sep, 2020 9 commits
-
-
Eric Myhre authored
This is probably now one of the nicer (directly-exercised) examples we have for how the type-level and representation-level views of data can differ with the use of schemas.
-
Eric Myhre authored
-
Eric Myhre authored
Interesting to note that this causes the go-wish library to drop out of the imports list entirely.
-
Eric Myhre authored
The increased coverage found an infinite loop in iterators, so the fix for this is included in this commit.
-
Eric Myhre authored
New testcase system for exercising typed nodes; Revamp struct tests to use it.
-
Eric Myhre authored
-
Eric Myhre authored
Though in general, letting golang's test system replace spaces and other unusual characters with underscores has very little downside, here, the resulting "_--_" is quite unpleasant on the eyes. Change things to use TitleCase.
-
Eric Myhre authored
This new system focuses on table-driven tests, and leans heavily upon json as a shorthand for expressing fixtures. It also makes a great deal more effort to exercise the different features of nodes (and their paired representation nodes) from all directions at once for each test datum, rather than requring that all be written out manually. The result is that the struct tests we've renovated have a lovely diffstat shrinkage: 111 insertions, 299 deletions... And yet the smaller line count results in *more* coverage. (Okay, the linecount increase for the testcase structure and helper methods is much bigger than the savings in fixture size... but, only *so far*. I assume this will continue to pay off in the future.) Relatedly: a bug in struct map representations has been fixed. (It was the sibling of 5f589653, embarassingly.) Thank goodness we now get proper coverage of this area. There's a few TODOs left to further expand the exercises, but those can slot in easily in subsequent commits. Same goes for further expansion of usage of this new system.
-
Eric Myhre authored
CI: switch from Travis to Actions
-
- 02 Sep, 2020 3 commits
-
-
Daniel Martí authored
They're actively maintained, faster on Mac and Windows, and generally a better mechanism long-term. The only change applied here, in practice, is that we now test on Mac and Windows as well.
-
Eric Myhre authored
(This type isn't really "embedded" in the others directly, so those docs were somewhat confusing.)
-
Eric Myhre authored
More code sections. Parts of this paragraph were being rendered as italics.
-
- 28 Aug, 2020 3 commits
-
-
Eric Myhre authored
fix(cidlink): check for byte buffer
-
hannahhoward authored
Use interface rather than concrete type for byte buffer checker
-
hannahhoward authored
-
- 27 Aug, 2020 1 commit
-
-
Eric Myhre authored
CI: test with Go 1.14 and 1.15, drop 1.12
-