1
exercism fetch bash nucleotide-count

nucleotide_count_test.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bats

@test "empty strand" {
        #skip
	run ./nucleotide_count.sh ""

	[ "$status" -eq 0 ]
	[ "$output" = $'A: 0\nC: 0\nG: 0\nT: 0' ]
}

@test "strand with repeated nucleotide" {
	skip
	run ./nucleotide_count.sh "GGGGGGG"

	[ "$status" -eq 0 ]
	[ "$output" = $'A: 0\nC: 0\nG: 7\nT: 0' ]
}

@test "strand with multiple nucleotides" {
	skip
	run ./nucleotide_count.sh "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"

	[ "$status" -eq 0 ]
	[ "$output" = $'A: 20\nC: 12\nG: 17\nT: 21' ]
}

@test "strand with invalid nucleotides" {
	skip
	run ./nucleotide_count.sh "AGXXACT"

	[ "$status" -eq 1 ]
	[ "$output" = "Invalid nucleotide in strand" ]
}