Skip to content

test: add tests for files being created and modified with text editors#215

Open
Molter73 wants to merge 3 commits intomainfrom
mauro/tests/editors
Open

test: add tests for files being created and modified with text editors#215
Molter73 wants to merge 3 commits intomainfrom
mauro/tests/editors

Conversation

@Molter73
Copy link
Contributor

@Molter73 Molter73 commented Jan 30, 2026

Description

Add tests that verify we get events when a file is created or modified via a text editor. Since we don't have rename events yet, we lose quite a bit of events, for instance sed modifies files via a temporary file and we don't see the final rename to the modified file, vi and its derivatives do a rename of the file to its name with ~ as a suffix which we also don't catch.

A new "strict" mode was added as an attempt to have tests fail when we implement new events in the future that we are missing now.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

The entire PR is tests.

We also add the ability to compare paths against a regex. This is useful
for sed because in place modifications are actually made through a
temporary file that uses a pattern that we have no control over.
After some manual testing, it seems nano does nothing special when
saving files and it is quite challenging to script it, so I decided to
remove it altogether.
@Molter73 Molter73 force-pushed the mauro/tests/editors branch from 25e26e2 to b6587f7 Compare February 2, 2026 15:23
@Molter73 Molter73 changed the title [WIP] test: add tests for files being created and modified with text editors test: add tests for files being created and modified with text editors Feb 2, 2026
@Molter73 Molter73 marked this pull request as ready for review February 2, 2026 15:41
@Molter73 Molter73 requested a review from a team as a code owner February 2, 2026 15:41
@Molter73 Molter73 enabled auto-merge (squash) February 2, 2026 15:41
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