1// +build !as_performance 2 3// Copyright 2013-2020 Aerospike, Inc. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// 9// http://www.apache.org/licenses/LICENSE-2.0 10// 11// Unless required by applicable law or agreed to in writing, software 12// distributed under the License is distributed on an "AS IS" BASIS, 13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14// See the License for the specific language governing permissions and 15// limitations under the License. 16 17package aerospike_test 18 19import ( 20 "encoding/hex" 21 22 as "github.com/aerospike/aerospike-client-go" 23 24 . "github.com/onsi/ginkgo" 25 . "github.com/onsi/gomega" 26) 27 28// ALL tests are isolated by SetName and Key, which are 50 random characters 29var _ = Describe("Key Test Reflection", func() { 30 31 Context("Digests should be the same", func() { 32 33 It("for Arrays", func() { 34 35 // The following two cases should be in exact order 36 key, _ := as.NewKey("namespace", "set", []int{1, 2, 3}) 37 Expect(hex.EncodeToString(key.Digest())).To(Equal("a8b63a8208ebebb49d027d51899121fd0d03d2f7")) 38 39 keyInterfaceArrayOfTheSameValues, _ := as.NewKey("namespace", "set", []interface{}{1, 2, 3}) 40 Expect(hex.EncodeToString(keyInterfaceArrayOfTheSameValues.Digest())).To(Equal(hex.EncodeToString(key.Digest()))) 41 42 }) 43 44 }) 45 46}) 47