Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
golanor committed Jan 30, 2024
1 parent abd2c50 commit a06f438
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions exercises/practice/protein-translation/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,81 @@ include("protein-translation.jl")

@testset "Protein Translation" begin

@test "Empty RNA sequence returns an empty list" begin
@testset "Empty RNA sequence returns an empty list" begin
@test rna"" == []
end

@test "Methionine RNA sequence is decoded as Methionine" begin
@testset "Methionine RNA sequence is decoded as Methionine" begin
@test rna"AUG" == ["Methionine"]
end

@test "Phenylalanine RNA sequence is decoded as Phenylalanine" begin
@testset "Phenylalanine RNA sequence is decoded as Phenylalanine" begin
@test rna"UUU" == ["Phenylalanine"]
end

@test "Other Phenylalanine RNA sequence is decoded as Phenylalanine" begin
@testset "Other Phenylalanine RNA sequence is decoded as Phenylalanine" begin
@test rna"UUC" == ["Phenylalanine"]
end

@test "Leucine RNA sequence is decoded as Leucine" begin
@testset "Leucine RNA sequence is decoded as Leucine" begin
@test rna"UUA" == ["Leucine"]
end

@test "Leucine RNA sequence is decoded as Leucine" begin
@testset "Leucine RNA sequence is decoded as Leucine" begin
@test rna"UUG" == ["Leucine"]
end

@test "Serine RNA sequence is decoded as Serine" begin
@testset "Serine RNA sequence is decoded as Serine" begin
@test rna"UCUUCCUCAUCG" == ["Serine", "Serine", "Serine", "Serine"]
end

@test "Tyrosine RNA sequence is decoded as Tyrosine" begin
@testset "Tyrosine RNA sequence is decoded as Tyrosine" begin
@test rna"UAUUAC" == ["Tyrosine", "Tyrosine"]
end

@test "Cysteine RNA sequence is decoded as Cysteine" begin
@testset "Cysteine RNA sequence is decoded as Cysteine" begin
@test rna"UGUUGC" == ["Cysteine", "Cysteine"]
end

@test "Tryptophan RNA sequence is decoded as Tryptophan" begin
@testset "Tryptophan RNA sequence is decoded as Tryptophan" begin
@test rna"UGG" == ["Tryptophan"]
end

@test "STOP codon terminates translation" begin
@testset "STOP codon terminates translation" begin
@test rna"UAA" == []
@test rna"UAG" == []
@test rna"UGA" == []
end

@test "Sequence of two codons translates into proteins" begin
@testset "Sequence of two codons translates into proteins" begin
@test rna"UUUUUU" == ["Phenylalanine", "Phenylalanine"]
end

@test "Sequence of two different codons translates into proteins" begin
@testset "Sequence of two different codons translates into proteins" begin
@test rna"UUAUUG" == ["Leucine", "Phenylalanine"]
end

@test "Translation stops if STOP codon appears in middle of sequence" begin
@testset "Translation stops if STOP codon appears in middle of sequence" begin
@test rna"UGGUAG" == ["Tryptophan"]
end

@test "Translation stops if STOP codon appears at beginning of sequence" begin
@testset "Translation stops if STOP codon appears at beginning of sequence" begin
@test rna"UAGUUUUGG" == []
end

@test "Translation stops if STOP codon appears at end of two-codon sequence" begin
@testset "Translation stops if STOP codon appears at end of two-codon sequence" begin
@test rna"UGGUGUUAUUAAUGGUUU" == ["Tryptophan", "Cysteine", "Tyrosine"]
end

@test "Non existent codon causes translation exception" begin
@testset "Non existent codon causes translation exception" begin
@test_throws TranslationError rna"AAA"
end

@test "Incomplete codon causes translation exception" begin
@testset "Incomplete codon causes translation exception" begin
@test_throws TranslationError rna"UGGU"
end

@test "Incomplete RNA sequence can translate if given a stop codon" begin
@testset "Incomplete RNA sequence can translate if given a stop codon" begin
@test rna"UGGUAGUAAAA" == ["Tryptophan"]
end
end

0 comments on commit a06f438

Please sign in to comment.