|
| 1 | +nucleotide_count = require 'nucleotide_count' |
| 2 | + |
| 3 | +describe 'nucleotide-count', -> |
| 4 | + it 'empty strand', -> |
| 5 | + expected = A: 0, C: 0, G: 0, T: 0 |
| 6 | + result = nucleotide_count '' |
| 7 | + assert.are.same expected, result |
| 8 | + |
| 9 | + pending 'can count one nucleotide in single-character input', -> |
| 10 | + expected = A: 0, C: 0, G: 1, T: 0 |
| 11 | + result = nucleotide_count 'G' |
| 12 | + assert.are.same expected, result |
| 13 | + |
| 14 | + pending 'strand with repeated nucleotide', -> |
| 15 | + expected = A: 0, C: 0, G: 7, T: 0 |
| 16 | + result = nucleotide_count 'GGGGGGG' |
| 17 | + assert.are.same expected, result |
| 18 | + |
| 19 | + pending 'strand with multiple nucleotides', -> |
| 20 | + expected = A: 20, C: 12, G: 17, T: 21 |
| 21 | + result = nucleotide_count 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC' |
| 22 | + assert.are.same expected, result |
| 23 | + |
| 24 | + pending 'strand with invalid nucleotides', -> |
| 25 | + f = -> nucleotide_count 'AGXXACT' |
| 26 | + assert.has.errors f, 'Invalid nucleotide in strand' |
0 commit comments