blob: d2959077d6c00ab25a337e2f40fb46f36695a54c (
plain) (
tree)
|
|
package securecookie
import "testing"
func TestUnsafeCodec(t *testing.T) {
c := NewUnsafeCodec()
str := `TestUnsafeCodec`
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)
}
}
|