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

Restructure tests for maintainability and ensure consecutive modified lines are trimmed. Fixes #43. #44

Merged
merged 4 commits into from
Jul 8, 2022

Conversation

mplellison
Copy link
Contributor

The previous test structure used a single sample file as the basis for all tests, which meant that adding a test case that modified the sample file needed changes across all result files to match. This meant it was harder than necessary to add tests, and doing so ran the risk of breaking old tests.

The change does slow down tests due to the constant closing and opening of files, but not very much in real terms (tests still take a few seconds to run).

#43 was caused by the getModifiedLineNumbers function only saving the first line of every "added" block, so only the first line was trimmed.

The intention is to make it easier to modify and extend individual tests
without impacting the entire suite. The repeated file loading does slow
down the test suite by a factor of about 5, but it's a reasonable small
suite so the real impact of this is minimal.
Previously, the test would fail with an unfulfilled promise, with the
error description given on stdout. Now the assertion error is caught and
passed to done, which gives a nicer output.
…m94#43.

At time of commit, these tests fail - only the first line of any block
of consecutive modified lines is trimmed.
@shardulm94 shardulm94 merged commit e4b65bc into shardulm94:master Jul 8, 2022
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