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

Implement isEmpty predicate #1202

Closed
wants to merge 2 commits into from
Closed

Implement isEmpty predicate #1202

wants to merge 2 commits into from

Conversation

Reachip
Copy link
Member

@Reachip Reachip commented Jan 25, 2023

This PR implement the "isEmpty" predicate.
Today, we are able to say:

GET https://api.foo.com
HTTP 200

[Asserts]
jsonpath "$.books" count == 0

We would like to be able to write:

GET https://api.foo.com
HTTP 200

[Asserts]
jsonpath "$.books" isEmpty

This predicate could work for collections or strings.

@Reachip Reachip linked an issue Jan 25, 2023 that may be closed by this pull request
@Reachip Reachip added the enhancement New feature or request label Jan 25, 2023
expected: 0.to_string(),
type_mismatch: false,
}),
_ => Ok(AssertResult {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The count filter (https://github.com/Orange-OpenSource/hurl/blob/master/packages/hurl/src/runner/filter.rs#L117) can also take a Bytes or Nodeset value, we could therefore add them in the empty predicate.

@fabricereix
Copy link
Collaborator

@Reachip
small detail, you could rebase all your commits into one?

@jcamiel jcamiel assigned jcamiel and unassigned jcamiel Jan 26, 2023
Format code

Fix integration tests

Fix useless use of format!

Publish Hurl 2.0.0 to npm.

Add get sum to chocolatey contrib section

Fix hurl test on chocolatey contrib section

Move from docker-hub to github-container-registry

Update docker contrib doc

Update winget contrib doc

Update chocolatey contrib

Update winget contrib doc

Fix clippy 1.67

Fix servers log artifacts

Update crates

Update cast poster for README.

Precise that --color does not affect HTTP response output.

Update FAQ with curl/Hurl features interaction.

Update crates

Fix some Hurl samples newlines.

Fix GraphQL query with variables to HTTP body request

Update Rust sample with hurl/hurl_core 2.0.0

Update change log.

Fix windows package artifacts

Fix push create release commits on ci

Update hurl version to 2.0.1-SNAPSHOT

Create 2.0.1 release

Update hurl version to 2.1.0-SNAPSHOT

Add Date value/filters

Fix docker contrib readme

Update installation with 2.0.1 links.

Update installation.md when releasing

Update npm publish scripts for 2.0.1

Fix https://www.hurl.dev to https://hurl.dev

Add README for Homebrew publication.

Replace google.fr by hurl.dev

Update crates

Update Hurl snippet in FAQ.

Update crates

Delete Progress and parse Hurl file before execution.

Reorganize Hurl output.

Fix variables-file example

Update crates

Finalize cleaning main structure.

Use Date for cookie Expires query

Fix focal mirror repo for ci

Use long options for curl command

Update crates

Update home with star links.

Update crates

Remove dead code.

Fix Markdown links.

Fix visibility of module html.

Update crates

Add progress bar for tests.

Make jsonpath module private.

Clean HTTP client fields.

Delete `redirect_count`.
Make `handle private.

Simplify execute HTTP client method.

Implements Default trait for RequestSpec.

Fix bad renaming.

Update crates

Add certificate query to grammar.

Add Certificate model for HTTP response.

Add Default impl for http::Response

Add associated function to create a Header.

Update crates

Fix report module visibility.

Fix import name for path utilities.

isEmpty can take Bytes and Nodeset value

Update bytes.py
@jcamiel jcamiel closed this Feb 15, 2023
@jcamiel jcamiel reopened this Feb 15, 2023
@jcamiel
Copy link
Collaborator

jcamiel commented Mar 3, 2023

I'm closing this PR we'll reopen a new PR once the implementation is done.

@jcamiel jcamiel closed this Mar 3, 2023
@jcamiel jcamiel removed a link to an issue Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants