summary refs log tree commit diff stats
path: root/LICENSE
blob: a5893df774e901efb834f9050ed4600a7ebe2d21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
Copyright (c) 2020, Andinus <andinus@inventati.org>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/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