on master help sign in
Fixed naming error in test functions in tutorial.
commit18931a41bf79d51ca4ec2420226ea5e57f33731c authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateFri 26 Jun 2015, 09:04 (11 years ago) parent9f04257
1 file changed+9−10
docs/tutorial/testing.rst+9−10
docs/tutorial/testing.rst+9−10
@@ -33,26 +33,25 @@ A simple test module, with a qualified name of ``Test.NumOps`` can be declared a
3333
3434 import Maths.NumOps
3535
36− assertTrue : Eq a => (given : a) -> (expected : a) -> IO ()
37− assertTrue g e = if g == e
36+ assertEq : Eq a => (given : a) -> (expected : a) -> IO ()
37+ assertEq g e = if g == e
3838 then putStrLn "Test Passed"
3939 else putStrLn "Test failed"
4040
41− assertFalse : Eq a => (given : a) -> (expected : a) -> IO ()
42− assertFalse g e = if not (g == e)
41+ assertNotEq : Eq a => (given : a) -> (expected : a) -> IO ()
42+ assertNotEq g e = if not (g == e)
4343 then putStrLn "Test Passed"
4444 else putStrLn "Test failed"
4545
4646 testDouble : IO ()
47− testDouble = assertTrue (double 2) 4
47+ testDouble = assertEq (double 2) 4
4848
4949 testTriple : IO ()
50− testTriple = assertFalse (triple 2) 5
50+ testTriple = assertNotEq (triple 2) 5
5151
5252
53−The functions ``assertTrue`` and ``assertFalse`` are used to run expected passing, and expected failing tests.
54−The actual tests are ``testDouble`` and ``testTriple``.
55−These tests are specified in the ``maths.ipkg`` file as follows::
53+The functions ``assertEq`` and ``assertNotEq`` are used to run expected passing, and failing, equality tests.
54+The actual tests are ``testDouble`` and ``testTriple``, and are declared in the ``maths.ipkg`` file as follows::
5655
5756 module maths
5857
@@ -63,4 +62,4 @@ These tests are specified in the ``maths.ipkg`` file as follows::
6362 , Test.NumOps.testTriple
6463
6564
66−The testing framework can be innvoked using: ``idris --testpkg maths.ipkg``.
65+The testing framework can be invoked using: ``idris --testpkg maths.ipkg``.