summary refs log tree commit diff stats
path: root/raku/rna-transcription/rna-transcription.rakutest
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-05 23:15:58 +0530
committerAndinus <andinus@nand.sh>2021-09-05 23:15:58 +0530
commit0fc602466192345311ba632da3ff456f20b9913c (patch)
treecf92bc8fc0aeba1d80bde026f4f07bf0c33e1da8 /raku/rna-transcription/rna-transcription.rakutest
parente9ed8248e4e63a7872f99ab31d777a6b54ca9740 (diff)
downloadexercism-0fc602466192345311ba632da3ff456f20b9913c.tar.gz
Raku: RNA: Add solution
Diffstat (limited to 'raku/rna-transcription/rna-transcription.rakutest')
-rw-r--r--raku/rna-transcription/rna-transcription.rakutest65
1 files changed, 65 insertions, 0 deletions
diff --git a/raku/rna-transcription/rna-transcription.rakutest b/raku/rna-transcription/rna-transcription.rakutest
new file mode 100644
index 0000000..a2db9ab
--- /dev/null
+++ b/raku/rna-transcription/rna-transcription.rakutest
@@ -0,0 +1,65 @@
+#!/usr/bin/env raku
+use Test;
+use JSON::Fast;
+use lib $?FILE.IO.dirname;
+use RNA;
+plan 6;
+
+my @test-cases = from-json($=pod[*-1].contents).List;
+for @test-cases -> %case {
+  is to-rna(%case<input><dna>), |%case<expected description>;
+}
+
+=head2 Test Cases
+=begin code
+[
+  {
+    "description": "Empty RNA sequence",
+    "expected": "",
+    "input": {
+      "dna": ""
+    },
+    "property": "toRna"
+  },
+  {
+    "description": "RNA complement of cytosine is guanine",
+    "expected": "G",
+    "input": {
+      "dna": "C"
+    },
+    "property": "toRna"
+  },
+  {
+    "description": "RNA complement of guanine is cytosine",
+    "expected": "C",
+    "input": {
+      "dna": "G"
+    },
+    "property": "toRna"
+  },
+  {
+    "description": "RNA complement of thymine is adenine",
+    "expected": "A",
+    "input": {
+      "dna": "T"
+    },
+    "property": "toRna"
+  },
+  {
+    "description": "RNA complement of adenine is uracil",
+    "expected": "U",
+    "input": {
+      "dna": "A"
+    },
+    "property": "toRna"
+  },
+  {
+    "description": "RNA complement",
+    "expected": "UGCACCAGAAUU",
+    "input": {
+      "dna": "ACGTGGTCTTAA"
+    },
+    "property": "toRna"
+  }
+]
+=end code