on master help sign in
Add example of running the tests

This lets the reader get the full experience of the example and also shows the temporary file path by way of the type-checker output. This does change the success/failure reporting text to match what I had written, so I could copy verbatim from my terminal. The previous success/failure messages had mismatched capitalization (title case vs sentence case), but their verbosity might have been desirable for a tutorial, however undesirable verbosity might be when scanning test output.

commit6411f5d2f2638a088f00b9ae56c1f67b9f4b554f authorJeremy W. Sherman <jeremyw.sherman@gmail.com> dateSat 8 Aug 2015, 14:42 (11 years ago) parentb880868
1 file changed+15−5
docs/tutorial/testing.rst+15−5
docs/tutorial/testing.rst+15−5
@@ -45,13 +45,13 @@ A simple test module, with a qualified name of ``Test.NumOps`` can be declared a
4545
4646 assertEq : Eq a => (given : a) -> (expected : a) -> IO ()
4747 assertEq g e = if g == e
48− then putStrLn "Test Passed"
49− else putStrLn "Test failed"
48+ then putStrLn "."
49+ else putStrLn "F"
5050
5151 assertNotEq : Eq a => (given : a) -> (expected : a) -> IO ()
5252 assertNotEq g e = if not (g == e)
53− then putStrLn "Test Passed"
54− else putStrLn "Test failed"
53+ then putStrLn "."
54+ else putStrLn "F"
5555
5656 testDouble : IO ()
5757 testDouble = assertEq (double 2) 4
@@ -72,4 +72,14 @@ The actual tests are ``testDouble`` and ``testTriple``, and are declared in the
7272 , Test.NumOps.testTriple
7373
7474
75−The testing framework can be invoked using: ``idris --testpkg maths.ipkg``.
75+The testing framework can then be invoked using ``idris --testpkg maths.ipkg``::
76+
77+ > idris --testpkg maths.ipkg
78+ Type checking ./Maths/NumOps.idr
79+ Type checking ./Test/NumOps.idr
80+ Type checking /var/folders/63/np5g0d5j54x1s0z12rf41wxm0000gp/T/idristests144128232716531729.idr
81+ .
82+ .
83+
84+Note how both tests have reported success by printing a single ``.``
85+as we arranged for with the ``assertEq`` and ``assertNoEq`` functions.