| // Copyright 2013 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| shouldPanic("len out of range", func() {_ = make(T, n)}) |
| shouldPanic("cap out of range", func() {_ = make(T, 0, n)}) |
| if unsafe.Sizeof(t) == 8 { |
| shouldPanic("len out of range", func() {_ = make(T, n)}) |
| shouldPanic("cap out of range", func() {_ = make(T, 0, n)}) |
| shouldPanic("len out of range", func() {_ = make(T, n)}) |
| shouldPanic("cap out of range", func() {_ = make(T, 0, n)}) |
| shouldPanic("len out of range", func() {_ = make(T, n)}) |
| shouldPanic("cap out of range", func() {_ = make(T, 0, n)}) |
| func shouldPanic(str string, f func()) { |
| if !strings.Contains(s, str) { |
| panic("got panic " + s + ", want " + str) |