✨
This commit is contained in:
@ -17,30 +17,22 @@ tests =
|
||||
[
|
||||
testCase "worker-add" $ do
|
||||
spc <- startSPC
|
||||
w <- workerAdd spc "Nikolaj"
|
||||
w <- workerAdd spc "R2-D2"
|
||||
isRight w @?= True,
|
||||
testCase "worker-add-2" $ do
|
||||
spc <- startSPC
|
||||
_ <- workerAdd spc "Nikolaj"
|
||||
w <- workerAdd spc "Alba"
|
||||
_ <- workerAdd spc "MSE-6"
|
||||
w <- workerAdd spc "GNK"
|
||||
isRight w @?= True,
|
||||
testCase "worker-add-3" $ do
|
||||
spc <- startSPC
|
||||
_ <- workerAdd spc "Nikolaj"
|
||||
_ <- workerAdd spc "Alba"
|
||||
w <- workerAdd spc "Sebastian"
|
||||
_ <- workerAdd spc "C-3PO"
|
||||
_ <- workerAdd spc "K-2SO"
|
||||
w <- workerAdd spc "IG-88"
|
||||
isRight w @?= True,
|
||||
testCase "worker-add-2-fail" $ do
|
||||
spc <- startSPC
|
||||
_ <- workerAdd spc "Nikolaj"
|
||||
w <- workerAdd spc "Nikolaj"
|
||||
isRight w @?= False,
|
||||
testCase "worker-job" $ do
|
||||
spc <- startSPC
|
||||
w <- workerAdd spc "Nikolaj"
|
||||
ref <- newIORef False
|
||||
case spc of (SPC c) -> sendTo c (writeIORef ref True) 1
|
||||
isRight w @?= True
|
||||
v <- readIORef ref
|
||||
v @?= True
|
||||
_ <- workerAdd spc "BD-1"
|
||||
w <- workerAdd spc "R5-D4"
|
||||
isRight w @?= False
|
||||
]
|
||||
|
Reference in New Issue
Block a user