Class Oracle

    • Field Detail

      • PASSED_TEST_MESSAGE

        public static final java.lang.String PASSED_TEST_MESSAGE
        What message will be recorded when a test passes with 100 pts.
        See Also:
        Constant Field Values
    • Method Detail

      • compare

        public abstract OracleResult compare​(java.lang.String expected,
                                             java.lang.String actual)
        Compare two strings to see if one is an acceptable variant of the other. The precise meaning of "acceptable" depends on the oracle and its settings.
        Parameters:
        expected - the expected string
        actual - the string being examined
        Returns:
        score and explanation
      • getIgnoreCase

        public boolean getIgnoreCase()
        Returns:
        true iff upper/lower case differences are ignored.
      • getPrecision

        public double getPrecision()
        How far floating point numbers may vary and still be considered equal. If negative, the comparison precision is derived from the expected value. E.g., if the expected value is printed with 2 digits after the decimal point, then the precision is 0.01.
        Returns:
        precision used when comparing floating point numbers.
      • getIgnoreWS

        public boolean getIgnoreWS()
        Returns:
        true iff differences in whitespace are being ignored.
      • getIgnoreEmptyLines

        public boolean getIgnoreEmptyLines()
        Returns:
        true iff empty lines are ignored.
      • getIgnorePunctuation

        public boolean getIgnorePunctuation()
        Returns:
        true iff punctuation is ignored.
      • getNumbersOnly

        public boolean getNumbersOnly()
        Returns:
        true if only numbers in the output are being checked.
      • getCommand

        public java.lang.String getCommand()
        Returns:
        command string to launch an external oracle.
      • getCap

        public int getCap()
        Returns:
        maximum number of points that can be scored.
      • getTestCase

        public TestCase getTestCase()
        Returns:
        the test case being examined.
      • getSubmission

        public Submission getSubmission()
        Returns:
        the submission
      • getStage

        public Stage getStage()
        Returns:
        the stage
      • getPattern

        public java.lang.String getPattern()
        Returns:
        the pattern