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

Assertion doesn't raise an error when it goes over the length of the tested string #35

Open
serkonda7 opened this issue Apr 11, 2022 · 2 comments

Comments

@serkonda7
Copy link

Consider the following pattern

{
	"name": "string",
	"begin": "'",
	"end": "'"
}

which is tested by this code:

fun main() {
    s:='my string'
//               ^^^^^^^^^^^^^ string
}

The test passes as the first ^ matches the tokens scope.

However I expect the test to fail, as all the following do not match.

@PanAeon
Copy link
Owner

PanAeon commented Apr 13, 2022

@serkonda7, thank you for reporting this bug.

First of all, a "false positive" has a well defined meaning in the computer science. According to wikipedia: "A false positive is an error in binary classification in which a test result incorrectly indicates the presence of a condition (incorrect scope in our case)". In other words a false positive for the grammar test would be reporting errors when the test should pass clean.

I think something like "A test misses lots of required scopes" conveys meaning much better.

Well, I can replicate the behavior but only when ^ are going over the length of the previous string. Is this matches your findings?

@PanAeon PanAeon changed the title required scope has lot's of false positives Assertion doesn't raise an error when it goes over the length of the tested string Apr 13, 2022
@serkonda7
Copy link
Author

Well, I can replicate the behavior but only when ^ are going over the length of the previous string. Is this matches your findings?

Yes, that's what I have observed.

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

No branches or pull requests

2 participants