It takes too much memory to be reliable and causes
trouble on 32-bit machines.
Sigh.
Fixes #2756.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
5567043
t.Errorf("wrong count; got %d want 0", n)
}
}
-
-func TestHuge(t *testing.T) {
- // About to use tons of memory, so avoid for simple installation testing.
- if testing.Short() {
- return
- }
- // We expect a panic.
- defer func() {
- if err, ok := recover().(error); ok && err == ErrTooLarge {
- return
- } else {
- t.Error(`expected "too large" error; got`, err)
- }
- }()
- b := new(Buffer)
- big := make([]byte, 500e6)
- for i := 0; i < 1000; i++ {
- b.Write(big)
- }
- t.Error("panic expected")
-}