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

Question Marks break Exact Test #117

Closed
sparry0407 opened this issue Oct 28, 2020 · 8 comments
Closed

Question Marks break Exact Test #117

sparry0407 opened this issue Oct 28, 2020 · 8 comments
Labels

Comments

@sparry0407
Copy link

If exact text in a test case contains a question mark, it breaks the comparison. so, if you have a test of:
output="ABC?"
This will fail a program that outputs:
ABC?

@jcrodriguez-dis
Copy link
Owner

I have not been able to reproduce this issue.
Please, show your vpl_evaluate.cases file and the student's program that does not pass the test.

Notice that your case definition does not accept anything after the "?" neither a newline.
To define a case that accepts exact outputs with and without a newline, you can use two outputs in this test case

output="ABC?"
output="ABC?
"

If some output defined matches the program output, the test case is passed.

@sparry0407
Copy link
Author

sparry0407 commented Oct 30, 2020 via email

@jcrodriguez-dis
Copy link
Owner

Sorry, I can not see your images.

I think that may be better to use the GitHub interface than reply by email.

You can use this link to access the thread

@sparry0407
Copy link
Author

sparry0407 commented Oct 30, 2020

Correct:
001
002
003

Incorrect:
004
005
006

It also does the same if the question mark is in the body of the text instead of at the end.

@sparry0407
Copy link
Author

I tried your suggestion, which worked. It does seem there is an inconsistency between how the tests are treated depending on whether question marks (and possibly other symbols) are in the text or not.

@jcrodriguez-dis
Copy link
Owner

Yes, you are right.

I have reviewed the code and found that the exact text matcher trims (cleans spaces, tabs, and newlines) the right side of the output if the searched text end with an alpha char.
This code was introduced to avoid frequent fails by newlines at the end of the output.
This code does that the "ABC" matches with print("ABC") in python, but really print("ABC") print also a newline.

I tried to reproduce the problem using C, but without including a "\n" at the end of the printf() this is why I don't found the problem.

Thanks for your report, I will fix this bug in the next release.

@sparry0407
Copy link
Author

sparry0407 commented Oct 30, 2020 via email

@jcrodriguez-dis
Copy link
Owner

Fixed in VPL 3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants