1. 07 Jun, 2021 1 commit
    • Daniel Martí's avatar
      node/tests: cover more error cases for scalar kinds · dab6ec7c
      Daniel Martí authored
      In particular, calling non-scalar Node and Assembler methods should
      always fail.
      
      While at it, remove some unused code, since unions always have
      representation strategies.
      
      Brings up code coverage in bindnode from 72.7% to 75%.
      dab6ec7c
  2. 03 Jun, 2021 2 commits
    • Daniel Martí's avatar
      node/tests: add more extensive scalar kind tests · b6e2b10f
      Daniel Martí authored
      It covers AssignKind, AssignNode, and AsKind for every combination of
      assembler kind and method.
      
      We also verify that a constructed scalar node behaves the same with
      AsKind when using its representation, like the old test.
      
      There's effectively a triple loop as a test table, so the subtest name
      has up to three components separated by dashes, such as:
      
      	TestSchema/Scalars/Bytes-AssignNode-String
      
      We also use this test as a demo of quicktest instead of go-wish.
      
      Finally, adapt bindnode to pass these tests just like codegen. This was
      mainly a bunch of TODOs in the relevant methods.
      b6e2b10f
    • Daniel Martí's avatar
      node/bindnode: start running all schema tests · 6042d4d8
      Daniel Martí authored
      We add node/tests.SchemaTestAll to simplify this task, meaning we don't
      need to duplicate all test func declarations in node/bindnode.
      SchemaTestAll is also flexible enough to allow running multiple
      sub-tests per schema test in the future.
      
      There were two remaining places in node/tests that still weren't using
      ipld.DeepEqual, so fix those.
      
      Finally, bindnode needed a couple of changes to fully support
      ipld.DeepEqual. Most notable is iteration over maps, which required a
      bit of a refactor to keep ordered keys.
      6042d4d8
  3. 25 May, 2021 1 commit
    • Daniel Martí's avatar
      node/bindnode: start of a reflect-based Node implementation · 806e36fb
      Daniel Martí authored
      Lots of TODOs and polishing to do, but it passes the schema/gen/go tests
      with minimal changes.
      
      Follow-up commits will continue filling in the gaps and adding
      documentation, notably examples. We'll also make the tests run by
      default, after a bit of refactoring.
      806e36fb