Class ExprTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
ExprTest
All Implemented Interfaces:
junit.framework.Test

public class ExprTest extends junit.framework.TestCase
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dbg(String fmt, Object... infos)
    Just like `System.err.printf` but for debugging-output; comment out its body to disable.
    void
     
    static void
    main(String... args)
    Manually call our test-functions (in case calling JUnit from your IDE isn't easy).
    void
    Sets up the test fixture.
    void
    Tears down the test fixture.
    void
    For every element in allTests, parse the string and eval the result, checking that we get back the second item in the pair.
    void
     
    void
    For every element in allTests, parse the string, and then call toString on the result, checking that we get back exactly the input string (up to whitespace).
    void
     

    Methods inherited from class junit.framework.TestCase

    assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ExprTest

      public ExprTest()
  • Method Details

    • main

      public static void main(String... args)
      Manually call our test-functions (in case calling JUnit from your IDE isn't easy).
    • testMyStuff

      public void testMyStuff()
    • testTowardsAutomating

      public void testTowardsAutomating()
    • setUp

      public void setUp()
      Sets up the test fixture. Called before test case method.
      Overrides:
      setUp in class junit.framework.TestCase
    • testParseToString

      public void testParseToString()
      For every element in allTests, parse the string, and then call toString on the result, checking that we get back exactly the input string (up to whitespace).
    • testEval

      public void testEval()
      For every element in allTests, parse the string and eval the result, checking that we get back the second item in the pair. If the second item is a Java Number, convert it to an E0 Num, and leave the double-comparison to Num.equals(Object).
    • logPassedTest

      public void logPassedTest()
    • tearDown

      public void tearDown()
      Tears down the test fixture. Called after every test case method.
      Overrides:
      tearDown in class junit.framework.TestCase
    • dbg

      public void dbg(String fmt, Object... infos)
      Just like `System.err.printf` but for debugging-output; comment out its body to disable. (This same method might be repeated in multiple classes, so that you turn messages on/off on a per-file basis.)
      Parameters:
      fmt - the format string
      infos - Any data needed by the `fmt` (one item per '%' in `fmt`)
      See Also: