dodona-edu / judge-java

JUnit-based Java judge for the Dodona learning environment
MIT License
1 stars 1 forks source link

Diff output in Interactive tests #16

Closed thepieterdc closed 5 years ago

thepieterdc commented 5 years ago

This PR adds the possibility to use diff feedback when using an Interactive test.

Usage:

public class InteractiveTest {
    @Rule
    public final Interactive interactive = Interactive.forClass(SomeExercise.class);

    @Test
    public void testInvalidOp() throws Throwable {
        final String expected = "Expected output from student.";

        this.interactive
            // Feed some input text.
            .feedLines("Input string", "Some other input")
            // Run the program.
            .callMain()
            // Check the output.
            .assertOutput(expected);
    }
}

Other notable changes

thepieterdc commented 5 years ago

Also, you accidently committed a class file in the testing directory.

Not sure how that can occur but I will remove it.