Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:dydaktyka:pp:haskell:lab-hunit [2018/06/08 22:53]
esimon [Funkcje i typy w HUnit]
pl:dydaktyka:pp:haskell:lab-hunit [2019/06/27 15:50]
Linia 1: Linia 1:
-====== Testy jednostkowe z HUnit ====== 
-Haskell udostępnia framework do testów jednostkowych o nazwie HUnit, który (podobno ;) ) inspirowany jest JUnitem z Javy. 
-Pełna dokumentacja:​ [[http://​hackage.haskell.org/​package/​HUnit|HUnit Documentation]] 
- 
-===== Instalacja ===== 
-HUnit nie jest domyślnie instalowany wraz z ghc/​ghci. ​ 
-Można go doinstalować,​ albo z repozytorium (Linux), albo używając pakietu '​haskell-stack':​ 
- 
-<​code>​ 
-stack install HUnit 
-</​code>​ 
- 
-===== Funkcje i typy w HUnit ===== 
- 
- 
-^Funckja^ Sygnatura^ 
-|assert | <​code haskell>​Assertable t => t -> Assertion</​code>​| 
-|assertFailure | <​code haskell>​assertFailure :: String -> Assertion</​code>​| 
-|assertBool | <​code haskell>​String -> Bool -> Assertion</​code>​| 
-|assertEqual | <​code haskell>​(Show a, Eq a) => String -> a -> a -> Assertion</​code>​| 
-|assertionPredicate | <​code haskell>​AssertionPredicable t => t -> AssertionPredicate</​code>​| 
-|assertString | <​code haskell>​String -> Assertion</​code>​| 
-|runTestTT | <code haskell>​Test -> IO Counts</​code>​| 
- 
- 
-^Typ ^ Definicja^ Opis^ 
-|Assertion|<​code>​type Assertion = IO ()</​code>​|X| 
-|Count|<​code haskell>​data Counts = Counts { cases, tried, errors, failures :: Int }  
-    deriving (Eq, Show, Read)</​code>​|X| 
-|Test|<​code haskell>​data Test = TestCase Assertion ​ 
-    | TestList [Test] ​ 
-    | TestLabel String Test</​code>​|X| 
- 
- 
- 
- 
- 
- 
  
pl/dydaktyka/pp/haskell/lab-hunit.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0