summaryrefslogtreecommitdiff
path: root/run_test.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-09-19 22:40:43 -0400
committerBen Burwell <ben@benburwell.com>2019-09-19 22:40:43 -0400
commit0e8f620f15592f66e733cc60dbaa722b183b0abf (patch)
tree87d27a3ce856324115bdf32b2b162d8c06c29dc6 /run_test.go
parent1a0c9f2e5704ee5acc59252a62d329d586e5aee2 (diff)
Remove dead code, fix package, add long test
Diffstat (limited to 'run_test.go')
-rw-r--r--run_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/run_test.go b/run_test.go
new file mode 100644
index 0000000..79a5a55
--- /dev/null
+++ b/run_test.go
@@ -0,0 +1,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()
+ }
+ })
+}