From 528352cddbe0290653c56a27a4134637ad0624e5 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Thu, 12 Sep 2019 16:21:08 -0400 Subject: Initial commit --- caesar_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 caesar_test.go (limited to 'caesar_test.go') diff --git a/caesar_test.go b/caesar_test.go new file mode 100644 index 0000000..e7dc3c0 --- /dev/null +++ b/caesar_test.go @@ -0,0 +1,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) + } +} -- cgit v1.2.3