Skip to content

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

Open
AlexLov wants to merge 1 commit into
BirdeeHub:mainfrom
AlexLov:tlib-fileNotContains
Open

feat(test-lib): add fileNotContains helper#573
AlexLov wants to merge 1 commit 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

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