summaryrefslogtreecommitdiff
path: root/test/MindTest.hs
blob: 5eb1734d36b21f5ca7f4fb5c00ad39536f71600b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module MindTest (suite) where

import Test.Tasty
import Test.Tasty.HUnit
import Mind

suite :: TestTree
suite = testGroup "mind tests" $
  [ neuronIndexTests
  , networkTests
  ]

neuronIndexTests :: TestTree
neuronIndexTests = testGroup "neuron index tests" $
  [ testCase "get input index" $ getNeuronIndex (Input 4) @?= 4
  , testCase "get internal index" $ getNeuronIndex (Internal 12) @?= 12
  , testCase "get output index" $ getNeuronIndex (Output 0) @?= 0
  ]

networkTests :: TestTree
networkTests = testGroup "network tests" $
  [ testCase "create empty network" $
    (createEmptyNetwork 3 2 1) @?= Network 3 [[], []] [[]]
  ]