aboutsummaryrefslogtreecommitdiff
path: root/litecodec_test.go
blob: 875ee7c3ce3690eda44c2fc40cce915f1a29c59c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)
	}
}