blob: 0433504cab7d4c769813d26b2146a8a781753038 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package principal
import (
"reflect"
"testing"
"v.io/x/ref/test/testutil"
)
func TestJSBlessingStore(t *testing.T) {
s := NewJSBlessingsHandles()
b := blessSelf(testutil.NewPrincipal(), "irrelevant")
h := s.Add(b)
if got := s.Get(h); !reflect.DeepEqual(got, b) {
t.Fatalf("Get after adding: got: %v, want: %v", got, b)
}
s.Remove(h)
if got := s.Get(h); !got.IsZero() {
t.Fatalf("Get after removing: got: %v, want nil", got)
}
}