go-hep.org/x/hep@v0.38.1/hbook/hbook_test.go (about) 1 // Copyright ©2020 The go-hep Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package hbook 6 7 import "testing" 8 9 func TestRangeClone(t *testing.T) { 10 r1 := Range{1, 2} 11 r2 := r1.clone() 12 13 if r1 != r2 { 14 t.Fatalf("range clone failed: got=%#v, want=%v", r2, r1) 15 } 16 17 r1.Min = -1 18 if r1 == r2 { 19 t.Fatalf("range clone did not deep-copy") 20 } 21 }