Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions exercises/practice/protein-translation/test/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ cases = [ Case { description = "Methionine RNA sequence"
, input = "UGGUGUUAUUAAUGGUUU"
, expected = Just ["Tryptophan","Cysteine","Tyrosine"]
}
, Case { description = "Translation fails on unknown codon"
, input = "ABC"
, expected = Nothing
}
, Case { description = "Translation stops if STOP codon before invalid codon"
, input = "UAGABC"
, expected = Just []
}
, Case { description = "Translation fails if codon is too short"
, input = "AUGA"
, expected = Nothing
}
, Case { description = "Translation stops if STOP codon before too short codon"
, input = "UAGA"
, expected = Just []
}
]

-- baf663fecc756872af85e8ae6ed24f3f7cbb9388