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

File::find[Start|End]OfStatement(): add QA tests #509

Merged
merged 2 commits into from
May 22, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 21, 2024

Description

Follow up on #502

File::findStartOfStatement(): fix some unintentional parse errors in the test case file

File::find[Start|End]OfStatement(): add QA tests

This commit adds two QA tests to find potential bugs in the File::find[Start|End]OfStatement() methods.

  1. It adds a test to ensure that the return value of File::findStartOfStatement() is never after the passed $start stack pointer.
  2. It adds a test to ensure that the return value of File::findEndOfStatement() is never before the passed $start stack pointer.

The tests use the existing test code, but tests all non-empty tokens within the file.

Note: this test doesn't test that the stack pointer returned is correct, only that it could be correct.

Suggested changelog entry

N/A

jrfnl added 2 commits May 22, 2024 00:53
This commit adds two QA tests to find potential bugs in the `File::find[Start|End]OfStatement()` methods.

1. It adds a test to ensure that the return value of `File::findStartOfStatement()` is never _after_ the passed `$start` stack pointer.
2. It adds a test to ensure that the return value of `File::findEndOfStatement()` is never _before_ the passed `$start` stack pointer.

The tests use the existing test code, but tests all non-empty tokens within the file.

Note: this test doesn't test that the stack pointer returned is _correct_, only that it _could_ be correct.
@jrfnl jrfnl added this to the 3.10.1 milestone May 21, 2024
@jrfnl jrfnl merged commit 3361ff2 into master May 22, 2024
50 checks passed
@jrfnl jrfnl deleted the feature/file-findstartendofstatement-add-extra-qa-test branch May 22, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant