Skip to content

feat: Add optional regex engine#110

Open
KlfJoat wants to merge 1 commit intobats-core:masterfrom
KlfJoat:feat/file_not_contains-engine
Open

feat: Add optional regex engine#110
KlfJoat wants to merge 1 commit intobats-core:masterfrom
KlfJoat:feat/file_not_contains-engine

Conversation

@KlfJoat
Copy link
Copy Markdown

@KlfJoat KlfJoat commented Feb 12, 2026

  • Expand assert_file_not_contains to allow an optional regex engine selection, to mirror assert_file_contains.

  • Change README to reflect this change.

  • Since there were no regex engine tests for assert_file_contains, I did not add any for my expanded assert_file_not_contains.

* Expand assert_file_not_contains to allow an optional regex engine
selection, to mirror assert_file_contains.

* Change README to reflect this change.

* Since there were no regex engine tests for assert_file_contains, I did
not add any for my expanded assert_file_not_contains.
@KlfJoat
Copy link
Copy Markdown
Author

KlfJoat commented Feb 12, 2026

Once this is approved, I will also expand the allowed regex engines in both assertions. I have found zgrep, zegrep, and zipgrep to be useful regex engines. I've modified bats-file locally to include them, and have found them useful over the past months.

Especially zipgrep, since a common modern method for creating application files is to ZIP up a collection of text files. This is used by EPUB, OpenDocument (ODT, ODS, etc), Office Open XML / OOXML (DOCX, XLSX, etc), and a few others where a simple grep MAY not find text in the file.

I do wonder if there is a way to create tests for these engines. But it might require modifying the test environment more than you find acceptable.

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.

1 participant