github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/internal/reflect/slice_test.go (about) 1 package reflect 2 3 import ( 4 "reflect" 5 "testing" 6 ) 7 8 func TestSlice(t *testing.T) { 9 slice := []int{12, 34, 56, 78, 90, 10, 23} 10 rawSlice := slice 11 slice = slice[3:] 12 s := SliceBackSpace(slice, 3) 13 if !reflect.DeepEqual(rawSlice, s) { 14 panic("backspace not equal") 15 } 16 }