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