Skip to content

feat(test-lib): add notFileContains helper - #573

Open
AlexLov wants to merge 2 commits into
BirdeeHub:mainfrom
AlexLov:tlib-fileNotContains
Open

feat(test-lib): add notFileContains helper#573
AlexLov wants to merge 2 commits into
BirdeeHub:mainfrom
AlexLov:tlib-fileNotContains

Conversation

@AlexLov

@AlexLov AlexLov commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This adds a complementary helper (to already existed fileContains) -- fileNotContains for simple comparison.

Generally it just negates result of grep expression from fileContains helper.

@MacaylaMarvelous81 MacaylaMarvelous81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Imperative test
[jomarm@dell-inspiron7773:~/nix-wrapper-modules]$ nix-instantiate --eval --expr '(((import <nixpkgs> {}).callPackage ./ci/test-lib.nix { self = import ./. {}; }).fileNotContains "maintainers/default.nix" "alexlov").cond'
"! grep -Eq -- 'alexlov' \"maintainers/default.nix\""

[jomarm@dell-inspiron7773:~/nix-wrapper-modules]$ ! grep -Eq -- 'alexlov' "maintainers/default.nix"; echo $?
1

Comment thread CONTRIBUTING.md Outdated
@AlexLov AlexLov changed the title feat(test-lib): add fileNotContains helper feat(test-lib): add notFileContains helper Jul 24, 2026

@zenoli zenoli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the update. LGTM!

@BirdeeHub I think this is ready to be merged.

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