summaryrefslogtreecommitdiff
path: root/run_test.go
blob: 79a5a55e83d2b300c5c83ac00dc948c193688151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package caesar

import "testing"

func TestCoder(t *testing.T) {
	coder := Coder{Key: 1, Ranges: []RuneRange{{'a', 'z'}}}
	t.Run("Encode", func(t *testing.T) {
		if coder.Encode("abc") != "bcd" {
			t.Fail()
		}
	})
	t.Run("Decode", func(t *testing.T) {
		if coder.Decode("bcd") != "abc" {
			t.Fail()
		}
	})
}