diff options
author | Ben Burwell <ben@benburwell.com> | 2019-09-16 15:56:31 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-09-16 16:29:16 -0400 |
commit | 679a62a9407c09be0cfb4e22455dca5ae694ce01 (patch) | |
tree | a99e8d61ada1677aee6f63a78545463308c5badd /caesar_test.go | |
parent | 528352cddbe0290653c56a27a4134637ad0624e5 (diff) |
Flesh out
Diffstat (limited to 'caesar_test.go')
-rw-r--r-- | caesar_test.go | 21 |
1 files changed, 19 insertions, 2 deletions
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() +} |