diff --git a/exercises/practice/rna-transcription/.meta/config.json b/exercises/practice/rna-transcription/.meta/config.json index fdba7616d..4cbae4013 100644 --- a/exercises/practice/rna-transcription/.meta/config.json +++ b/exercises/practice/rna-transcription/.meta/config.json @@ -19,7 +19,8 @@ "sjwarner-bp", "solaryeti", "tejasbubane", - "yurrriq" + "yurrriq", + "tasxatzial" ], "files": { "solution": [ diff --git a/exercises/practice/rna-transcription/.meta/example.clj b/exercises/practice/rna-transcription/.meta/example.clj index b03a6df1c..0494c91ec 100644 --- a/exercises/practice/rna-transcription/.meta/example.clj +++ b/exercises/practice/rna-transcription/.meta/example.clj @@ -5,9 +5,5 @@ \A \U \T \A}) -(defn- translate [c] - {:post [%]} - (dna->rna c)) - (defn to-rna [dna] - (apply str (map translate dna))) + (apply str (map dna->rna dna))) diff --git a/exercises/practice/rna-transcription/.meta/generator.tpl b/exercises/practice/rna-transcription/.meta/generator.tpl new file mode 100644 index 000000000..6ef152091 --- /dev/null +++ b/exercises/practice/rna-transcription/.meta/generator.tpl @@ -0,0 +1,9 @@ +(ns rna-transcription-test + (:require [clojure.test :refer [deftest testing is]] + rna-transcription)) + +{{#test_cases.toRna}} +(deftest to-rna_test_{{idx}} + (testing {{description}} + (is (= {{expected}} (rna-transcription/to-rna {{input.dna}}))))) +{{/test_cases.toRna}} diff --git a/exercises/practice/rna-transcription/src/rna_transcription.clj b/exercises/practice/rna-transcription/src/rna_transcription.clj index 1ad85ab7e..1e1e3e122 100644 --- a/exercises/practice/rna-transcription/src/rna_transcription.clj +++ b/exercises/practice/rna-transcription/src/rna_transcription.clj @@ -1,5 +1,7 @@ (ns rna-transcription) -(defn to-rna [dna] ;; <- arglist goes here - ;; your code goes here -) +(defn to-rna + "Returns the RNA complement of the given DNA string sequence." + [dna] + ;; function body + ) diff --git a/exercises/practice/rna-transcription/test/rna_transcription_test.clj b/exercises/practice/rna-transcription/test/rna_transcription_test.clj index eafaf2d6b..394a9548e 100644 --- a/exercises/practice/rna-transcription/test/rna_transcription_test.clj +++ b/exercises/practice/rna-transcription/test/rna_transcription_test.clj @@ -2,26 +2,26 @@ (:require [clojure.test :refer [deftest testing is]] rna-transcription)) -(deftest empty-sequence +(deftest to-rna_test_1 (testing "Empty RNA sequence" (is (= "" (rna-transcription/to-rna ""))))) -(deftest rna-complement-of-cytosine +(deftest to-rna_test_2 (testing "RNA complement of cytosine is guanine" (is (= "G" (rna-transcription/to-rna "C"))))) -(deftest rna-complement-of-guanine +(deftest to-rna_test_3 (testing "RNA complement of guanine is cytosine" (is (= "C" (rna-transcription/to-rna "G"))))) -(deftest rna-complement-of-thymine +(deftest to-rna_test_4 (testing "RNA complement of thymine is adenine" (is (= "A" (rna-transcription/to-rna "T"))))) -(deftest rna-complement-of-adenine +(deftest to-rna_test_5 (testing "RNA complement of adenine is uracil" (is (= "U" (rna-transcription/to-rna "A"))))) -(deftest rna-complement +(deftest to-rna_test_6 (testing "RNA complement" (is (= "UGCACCAGAAUU" (rna-transcription/to-rna "ACGTGGTCTTAA")))))