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

Added assert not command (assertion that the value/expression is false) #9235

Merged
merged 3 commits into from May 19, 2023

Conversation

skelly37
Copy link
Contributor

Description

A new command to simplify assertions for false.

The name is just a draft, though I could not come up with a better name. I have rejected assert false, because I would have to rename assert to assert true which would break the compatibility and worsen the shell experience of the good old assert.

Another idea I have rejected was something like assert_false to keep it consistent with the naming convention of our stdlib.

I am open to suggestions :)

User-Facing Changes

Just a new command

Tests + Formatting

  • Done

After Submitting

@skelly37 skelly37 changed the title Added assert not command with its test Added assert not command (assertion that the value/expression is false) May 19, 2023
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Merging #9235 (9c1b06e) into main (e752d8a) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9235   +/-   ##
=======================================
  Coverage   68.53%   68.53%           
=======================================
  Files         636      636           
  Lines      102281   102281           
=======================================
  Hits        70099    70099           
  Misses      32182    32182           

@amtoine amtoine added the std-library Defining and improving the standard library written in nu and the core Rust ccommands label May 19, 2023
Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

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

i think assert not is fine 👍

i've got 2 remarks that you can either address or not, they are not directly related to this PR 😌

crates/nu-std/tests/test_logger.nu Outdated Show resolved Hide resolved
crates/nu-std/lib/testing.nu Outdated Show resolved Hide resolved
Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

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

looks very nice, thanks @skelly37 😊 ✨

@amtoine
Copy link
Member

amtoine commented May 19, 2023

it's all green, so let's land this 😉

@amtoine amtoine merged commit ca275f5 into nushell:main May 19, 2023
18 checks passed
@skelly37 skelly37 deleted the feature/negative_assertion branch May 19, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
std-library Defining and improving the standard library written in nu and the core Rust ccommands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants