Skip to content

Commit

Permalink
[#500] Trails-test: Update test comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-stacey committed Aug 19, 2019
1 parent 0a54da3 commit 9288093
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions projects/trails/test/Mirza/Trails/Tests/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ clientSpec = do
bottomOutput <- join $ fmap addNextEntry $ fmap (flip joinEntries (trailEntrySignature $ head inputArrow)) $ fmap pure $ buildEntry
pure $ inputAndTopOutput <> bottomOutput
longWing <- buildLongWing
checkTrailWithContext "Long Wing Trail" longWing
checkTrailWithContext "Long Wing Trail (see code comment diagram)" longWing

-- Trail: /--*--\
-- * *
Expand All @@ -155,7 +155,7 @@ clientSpec = do
let joinedEntry = foldl joinEnd newEntry forkedNext
pure $ joinedEntry : forkedNext
ringTrail <- buildRing
checkTrailWithContext "Ring Trail" ringTrail
checkTrailWithContext "Ring Trail (see code comment diagram)" ringTrail

-- Trail: /--*--\
-- *-------*
Expand All @@ -169,7 +169,7 @@ clientSpec = do
entry
pure $ (makeBaseParentOf <$> ring)
burgerTrail <- buildBurger
checkTrailWithContext "Burger Trail" burgerTrail
checkTrailWithContext "Burger Trail (see code comment diagram)" burgerTrail

-- Trail: *---*
-- /
Expand All @@ -190,7 +190,7 @@ clientSpec = do
bottomOutput <- addNextEntry $ pure $ foldl addPreviousEntrySignature outputNode (trailEntrySignature <$> [head topInput, head bottomInput])
pure $ topOutput <> bottomOutput <> topInput <> bottomInput
latticeTrail <- buildLattice
checkTrailWithContext "Lattice Trail" latticeTrail
checkTrailWithContext "Lattice Trail (see code comment diagram)" latticeTrail

-- Trail: *---*---*
-- :
Expand Down Expand Up @@ -274,7 +274,7 @@ addPreviousEntry entries = do

joinEntries :: [TrailEntry] -> SignaturePlaceholder -> [TrailEntry]
joinEntries (entry : entries) sig = (addPreviousEntrySignature entry sig) : entries
-- Could just define the following as buildEntry, but it seems that this is likely to be a logic error and so its probably better to just fail here.
-- Could just define the following as buildEntry, but it seems that this is likely to be a logic error and so its probably better to just fail here.
joinEntries [] _ = error "Error: There is a logic error in the tests. Can't add a previous entry of a non existant entry."


Expand All @@ -286,7 +286,7 @@ addNextEntry entries@(entry : _) = do
newEntry <- buildEntry
let updatedNewEntryWithPreviousEntry = addPreviousEntrySignature newEntry (trailEntrySignature entry)
pure $ updatedNewEntryWithPreviousEntry : entries
-- Could just define the following as buildEntry, but it seems that this is likely to be a logic error and so its probably better to just fail here.
-- Could just define the following as buildEntry, but it seems that this is likely to be a logic error and so its probably better to just fail here.
addNextEntry [] = error "Error: There is a logic error in the tests. Can't add the next entry of a non existant entry."


Expand Down

0 comments on commit 9288093

Please sign in to comment.