Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(selector): add tests for "Supported Forms" #15

Conversation

smoyer64
Copy link
Contributor

Supported forms testing

This PR provides a set of testcases to verify that the Selector behaves properly according to the "Supported Forms" table proposed in a GitHub issue at ucan-wg/delegation#5 (comment).

The test cases are divided into three groups:

  • Tests that should return one or more IPLD datamodel.Nodes
  • Tests that should return "null" which is currently replaced by nil in Go
  • Tests that should return an error

Currently all the nil and error testcases pass. There are ten node testcases that are failing with two having obvious causes:

  1. The "Negative Index" test properly Parses the Selector text but fails with an index out of range [-1] panic when Select is called.

  2. The "Optional Iterator" test returns the expected values but also a nil value for the second element which isn't a List. This should probably be pruned during Select.

Copy link
Member

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just going to merge this into @alanshaw 's branch. It looks helpful! Thank you so much @smoyer64

@hannahhoward hannahhoward merged commit 178a323 into storacha:feat/delegation-chain-validation Aug 28, 2024
@fabiobozzo
Copy link

FYI: I prepared a PR with fixes for all broken "Pass" selector tests, currently listed in go-ucan: ucan-wg/go-ucan#18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants