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

import (
	"testing"
)

func TestCaesar(t *testing.T) {
	msg := "Attack at dawn"
	encoded := Encode(msg)
	if encoded == msg {
		t.Errorf("expected ciphertext and plaintext to differ")
	}
	decoded := Decode(encoded)
	if decoded != msg {
		t.Errorf("expected recovered plaintext to match message, but got: %s", decoded)
	}
}