Sha256: 899d8544f059ce1a561aea0e9e9d9ee0a440534b08f9d1ff3dd0c26597ffdb3f

Contents?: true

Size: 994 Bytes

Versions: 63

Compression:

Stored size: 994 Bytes

Contents

import ceylon.test {
    ...
}

// Tests adapted from problem-specifications version 1.2.0
// The Ceylon track keeps the Error cases from 1.0.1 (removed in 1.1.0)

{[String, String|Null]*} cases => {
    // empty strand
    ["", ""],
    // single C nucleotide strand
    ["C", "G"],
    // single G nucleotide strand
    ["G", "C"],
    // single A nucleotide strand
    ["A", "U"],
    // single T nucleotide strand
    ["T", "A"],
    // longer strand
    ["ACGTGGTCTTAA", "UGCACCAGAAUU"],
    // strand with DNA nucleotides
    ["U", null],
    // strand with invalid nucleotides
    ["XCGFGGTDTTAA", null],
    // strand with invalid nucleotides after the first nucleotide
    ["ACGTFGTBTEAA", null]
};

test
parameters (`value cases`)
void testHamming(String dna, String|Null expected) {
    if (exists expected) {
        assertEquals(transcription(dna), expected);
    } else if (!is Error result = transcription(dna)) {
        fail("should have errored, but got ``result``");
    }
}

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.179 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.178 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.177 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.176 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.175 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.174 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.173 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.172 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.171 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.170 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.169 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.167 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.166 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.165 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.164 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.163 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.162 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.161 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon
trackler-2.2.1.160 tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon