public
Description: This is a space for projects that maybe did or didn't start at a Dojo session and the participants continued developing.
Homepage: http://groups.google.com/group/dojo_sp
Clone URL: git://github.com/dojosp/participant-s-projects.git
Dojo (author)
Mon Jun 22 19:44:58 -0700 2009
commit  9a787ec3cd3e532cb890c37ae261794b0d1777c6
tree    1cff1c2aba885eb76fec62566aa09cb2617f7773
parent  feb0f4307a2d14abea28b3bdfaecd07de80755eb parent  32cf703a82fe153f34e0ee8c314c0c63f04de401
100755 37 lines (31 sloc) 1.197 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module Main where
 
import Test.HUnit
import Sanduiche
 
main = runTestTT testes
 
testes = TestList [verificaMontaMatriz , testaJuncaoDeListas, testeCriaMatrizAchatada]
 
verificaMontaMatriz = TestList
["Nao monta uma matriz de tamanho 1" ~:
[[1]] ~=? montaMatriz [1]
,"Nao monta uma matriz de tamanho 1 com valor 2" ~:
[[4]] ~=? montaMatriz [2]
,"Nao monta uma matriz de tamanho 2" ~:
[[1,2],[2,4]] ~=? montaMatriz [1,2]
,"Nao monta uma matriz de tamanho 2 com valores certos" ~:
[[100,200],[200,400]] ~=? montaMatriz [10,20]
,"Nao monta uma matriz de tamanho 3 com valores certos" ~:
[[1,2,3],[2,4,6],[3,6,9]] ~=? montaMatriz [1,2,3]
,"Nao monta uma matriz de tamanho 3 com outros valores" ~:
[[1,3,5],[3,9,15],[5,15,25]] ~=? montaMatriz [1,3,5]
]
 
testaJuncaoDeListas = TestList
["Nao juntou listas com um elemento cada" ~:
[[1, 1]] ~=? juntaListas [1] [[1]]
,"Nao juntou listas com um elemento diferente na matriz" ~:
[[1, 2]] ~=? juntaListas [1] [[2]]
,"Nao juntou listas com um elemento diferente na lista" ~:
[[10, 2]] ~=? juntaListas [10] [[2]]
]
 
testeCriaMatrizAchatada = TestList
["Nao achatou a matriz com quatro elementos" ~:
[1, 2, 2, 4] ~=? achataMatriz [1,2]
]