on master help sign in
Fixed naming error in test functions in tutorial.
18931a4Jan de Muijnck-Hughes
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
33
33
34 import Maths.NumOps
34 import Maths.NumOps
35
35
36− assertTrue : Eq a => (given : a) -> (expected : a) -> IO ()
36+ assertEq : Eq a => (given : a) -> (expected : a) -> IO ()
37− assertTrue g e = if g == e
37+ assertEq g e = if g == e
38 then putStrLn "Test Passed"
38 then putStrLn "Test Passed"
39 else putStrLn "Test failed"
39 else putStrLn "Test failed"
40
40
41− assertFalse : Eq a => (given : a) -> (expected : a) -> IO ()
41+ assertNotEq : Eq a => (given : a) -> (expected : a) -> IO ()
42− assertFalse g e = if not (g == e)
42+ assertNotEq g e = if not (g == e)
43 then putStrLn "Test Passed"
43 then putStrLn "Test Passed"
44 else putStrLn "Test failed"
44 else putStrLn "Test failed"
45
45
46 testDouble : IO ()
46 testDouble : IO ()
47− testDouble = assertTrue (double 2) 4
47+ testDouble = assertEq (double 2) 4
48
48
49 testTriple : IO ()
49 testTriple : IO ()
50− testTriple = assertFalse (triple 2) 5
50+ testTriple = assertNotEq (triple 2) 5
51
51
52
52
53−The functions ``assertTrue`` and ``assertFalse`` are used to run expected passing, and expected failing tests.
53+The functions ``assertEq`` and ``assertNotEq`` are used to run expected passing, and failing, equality tests.
54−The actual tests are ``testDouble`` and ``testTriple``.
54+The actual tests are ``testDouble`` and ``testTriple``, and are declared in the ``maths.ipkg`` file as follows::
55−These tests are specified in the ``maths.ipkg`` file as follows::
56
55
57 module maths
56 module maths
58
57
@@ -63,4 +62,4 @@ These tests are specified in the ``maths.ipkg`` file as follows::
63 , Test.NumOps.testTriple
62 , Test.NumOps.testTriple
64
63
65
64
66−The testing framework can be innvoked using: ``idris --testpkg maths.ipkg``.
65+The testing framework can be invoked using: ``idris --testpkg maths.ipkg``.