aboutsummaryrefslogtreecommitdiff
path: root/litecodec_test.go
diff options
context:
space:
mode:
authorHank Shen <swh@admpub.com>2023-12-06 06:54:31 +0300
committerHank Shen <swh@admpub.com>2023-12-06 06:54:31 +0300
commitc33b59bcab7ae16914ebeae200a6195204e76b3a (patch)
tree9109c2b0a73820f37e9f4cc7a50bea73d0825d25 /litecodec_test.go
parent75a1bf157648c5b5c155ac81e4950bff5315c0ae (diff)
updatev1.2.3
Diffstat (limited to 'litecodec_test.go')
-rw-r--r--litecodec_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/litecodec_test.go b/litecodec_test.go
new file mode 100644
index 0000000..875ee7c
--- /dev/null
+++ b/litecodec_test.go
@@ -0,0 +1,20 @@
+package securecookie
+
+import "testing"
+
+func TestLiteCodec(t *testing.T) {
+ c := NewLiteCodec()
+ str := `TestLiteCodec`
+ encoded, err := c.Encode(`name`, str)
+ if err != nil {
+ t.Error(err)
+ }
+ var decoded string
+ err = c.Decode(`name`, encoded, &decoded)
+ if err != nil {
+ t.Error(err)
+ }
+ if decoded != str {
+ t.Fatalf("expected %s, got: %#v", str, decoded)
+ }
+}