Skip to content

Test files may have a "contains" instead of an "equals" to check the location value #147

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

Closed
brigittehuynh opened this issue Aug 20, 2018 · 1 comment · Fixed by #207
Closed
Labels
bug done Used when an issue is implemented but not yet released shell
Milestone

Comments

@brigittehuynh
Copy link
Collaborator

Expected behavior

Test files should check that the location found equals the expected location

Actual behavior

In the Shell COM.PRES.Indent rule the test checked if one of the locations contained the other, resulting in a false positive (ma_fonction_affine included in ma_fonction_affine2)
The test has been corrected in the COM.PRES.Indent rule but the tests of the other rules need checking.

Steps to reproduce behavior

In test files, the testRunWithError method needs location.contains(LOCATIONS[index]) changed to location.equals(LOCATIONS[index]) in the value verification part

Detection version

3.1.0-dev

@brigittehuynh brigittehuynh changed the title Test files may have a contain insteaf of an equal for the location value Test files may have a "contains" instead of an "equals" to check the location value Aug 20, 2018
@begarco begarco added this to the Version 4.1.0 milestone Mar 6, 2020
@begarco
Copy link
Contributor

begarco commented Apr 6, 2020

Currently, there is only one generic testRunWithError function in icode-core/src/main/java/fr/cnes/icode/test/ICodeCheckerTester.java.

It contains assertTrue(location.contains(locations[index])); so we have to change it to assertTrue(location.equals(locations[index]));.

@begarco begarco added the done Used when an issue is implemented but not yet released label Apr 6, 2020
begarco added a commit that referenced this issue Apr 6, 2020
begarco added a commit that referenced this issue Apr 6, 2020
@begarco begarco mentioned this issue Apr 6, 2020
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done Used when an issue is implemented but not yet released shell
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants