~telemachus/Exercism

ref: 392885548959505a17ef8731a06b37a972bdd1df Exercism/go/atbash-cipher/atbash_cipher_test.go -rw-r--r-- 447 bytes
39288554Peter Aronoff Atbash cipher 6 months ago
                                                                                
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
package atbash

import "testing"

func TestAtbash(t *testing.T) {
	for _, test := range tests {
		actual := Atbash(test.s)
		if actual != test.expected {
			t.Errorf("Atbash('%s'): expected '%s', actual '%s'", test.s, test.expected, actual)
		}
	}
}

func BenchmarkAtbash(b *testing.B) {
	if testing.Short() {
		b.Skip("skipping benchmark in short mode.")
	}
	for i := 0; i < b.N; i++ {

		for _, test := range tests {
			Atbash(test.s)
		}

	}
}