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

Add negative filter tests #425

Merged
merged 23 commits into from
Aug 4, 2023
Merged

Conversation

u9g
Copy link
Contributor

@u9g u9g commented Aug 2, 2023

No description provided.

trustfall_core/src/interpreter/execution.rs Show resolved Hide resolved
trustfall_core/src/interpreter/execution.rs Outdated Show resolved Hide resolved
trustfall_core/src/interpreter/execution.rs Outdated Show resolved Hide resolved
trustfall_core/src/interpreter/execution.rs Show resolved Hide resolved
@@ -0,0 +1,19 @@
TestGraphQLQuery (
// We use a negative number as a filter to ensure that we properly handle the negative number case in get_max_fold_count_limit.
Copy link
Owner

Choose a reason for hiding this comment

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

A few issues here:

  • This line is too long. We don't currently have a linter set up, but please try to keep lines below 100 chars in all files to make sure they are readable.
  • The comment references implementation details that may change and that ultimately aren't important. The test ensures that comparisons with negative numbers on count work in general, and would catch any failures even if they aren't in get_max_fold_count_limit(). I wouldn't name that function or any other implementation details here.
  • get_max_fold_count_limit() is code and a function. Please try to always put code in backticks and have function names followed by () to show they are functions.

Copy link
Contributor Author

@u9g u9g Aug 3, 2023

Choose a reason for hiding this comment

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

I spruced up the comments in the tests to look like this:

// Ensure that we properly handle negative numbers in a `not_one_of` filter on a folded edge's count.

I believe this is the longest one, and it's 101 characters including // so I think that's fine for now. I removed any mentions to internals in tests, good call.

@obi1kenobi obi1kenobi merged commit 7c84689 into obi1kenobi:main Aug 4, 2023
@u9g u9g deleted the add-negative-filter-tests branch August 4, 2023 00:55
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.

2 participants