testmycode / edu-test-utils

Library for testing student code.
http://testmycode.net/edu-test-utils/javadoc/
GNU Lesser General Public License v3.0
5 stars 4 forks source link

Add fuzzy text matching assertion #8

Open jamo opened 8 years ago

jamo commented 8 years ago

create assertMatches(String, String) or similar which could be used in the tests for testing whether printed text matches expectations but let's some typos etc. thru.

Maybe we could have some kind of level of strictness.

There are plenty of fuzzy match algos so it should be rather easy to implement.

mpartel commented 8 years ago

What are some examples where this would be better than assertContains?

jamo commented 8 years ago

Like when we ask for students to print: type a number: and the student prints type number -- now the tests keeps on focusing to whine about the incorrectly typed in text, when we rarely need to whine about typos. This would be useful especially with computer exam situations, where we in general want to be more generous about typos etc.

mpartel commented 8 years ago

Ok, that case makes sense (though I suppose you could alternatively ignore the text of the prompt, or work to improve the error messages). Will have to be careful about not making the implementation too permissive.