From 679a62a9407c09be0cfb4e22455dca5ae694ce01 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Mon, 16 Sep 2019 15:56:31 -0400 Subject: Flesh out --- caesar_test.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'caesar_test.go') diff --git a/caesar_test.go b/caesar_test.go index e7dc3c0..04b853b 100644 --- a/caesar_test.go +++ b/caesar_test.go @@ -4,14 +4,31 @@ import ( "testing" ) +func TestEncode(t *testing.T) { + msg := "Attack at dawn" + if Encode(msg) != "Dwwdfn dw gdzq" { + t.Fail() + } +} + func TestCaesar(t *testing.T) { + if testing.Short() { + t.Skip() + } msg := "Attack at dawn" + t.Logf("testing encoding message %s", msg) encoded := Encode(msg) if encoded == msg { - t.Errorf("expected ciphertext and plaintext to differ") + t.Log("expected ciphertext and plaintext to differ") + t.Fail() } decoded := Decode(encoded) if decoded != msg { - t.Errorf("expected recovered plaintext to match message, but got: %s", decoded) + t.Logf("expected recovered plaintext to match message, but got: %s", decoded) + t.Fail() } } + +func BenchmarkCaesar(b *testing.B) { + b.Fail() +} -- cgit v1.2.3