summaryrefslogtreecommitdiff
path: root/securecookie_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'securecookie_test.go')
-rw-r--r--securecookie_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/securecookie_test.go b/securecookie_test.go
index 0187ba0..099c290 100644
--- a/securecookie_test.go
+++ b/securecookie_test.go
@@ -10,6 +10,7 @@ import (
"crypto/sha256"
"errors"
"fmt"
+ "strings"
"testing"
)
@@ -131,6 +132,18 @@ func TestEncoding(t *testing.T) {
}
}
+func TestMultiError(t *testing.T) {
+ s1, s2 := New(nil, nil), New(nil, nil)
+ _, err := EncodeMulti("sid", "value", s1, s2)
+ if len(err.(MultiError)) != 2 {
+ t.Errorf("Expected 2 errors, got %s.", err)
+ } else {
+ if strings.Index(err.Error(), "hash key is not set") == -1 {
+ t.Errorf("Expected missing hash key error, got %s.", err.Error())
+ }
+ }
+}
+
// ----------------------------------------------------------------------------
type FooBar struct {