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

containsf revisited #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

containsf revisited #42

wants to merge 3 commits into from

Conversation

kinbiko
Copy link
Owner

@kinbiko kinbiko commented Jun 22, 2023

Tries to do #40 again, but with an up-to-date branch.

Discovered a key design issue I'd want to design around instead of accept any compromise.

Checklist

  • I have done a self-review of the PR.

@kinbiko kinbiko changed the title chore: bump go version containsf revisited Jun 23, 2023
@kinbiko kinbiko force-pushed the implement-containsf-revisited branch from 56580f8 to e30b006 Compare June 24, 2023 02:48
@kinbiko kinbiko force-pushed the implement-containsf-revisited branch from e30b006 to 67a29ac Compare June 24, 2023 02:54
// Currently, in the case of "Containsf" there's an implicit "<<UNORDERED>>" (if it's explicitly written it will be ignored)
// This is so that nested arrays don't have to repeatedly say "<<UNORDERED">> assuming the user just wants to check for the existence of some element of an array.
// However, this makes jsonassert useless for cases where you want to partially assert that an ordered array exists.
// Ideally this package should be able to support both nicely.
Copy link
Owner Author

@kinbiko kinbiko Jun 24, 2023

Choose a reason for hiding this comment

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

Idea 1

  • Assertf: Implicit "<<ORDERED>>", explicit "<<UNORDERED>>"
  • Containsf: Implicit "<<UNORDERED>>", explicit "<<ORDERED>>"

When *f is called with an implicit directive it is ignored.

When *f is called with an explicit directive it applies on only that array.

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.

None yet

1 participant