mirror of
https://github.com/golang/go
synced 2024-11-24 18:30:16 -07:00
test: test slice beyond len
When slicing a slice, the bounds may be > len as long as they are <= cap. Interestingly, gccgo got that wrong and still passed the testsuite and all the library tests. R=golang-dev, rsc, iant CC=golang-dev https://golang.org/cl/5622053
This commit is contained in:
parent
8f9434b6c1
commit
450c955bd9
@ -68,6 +68,9 @@ func testpdpd() {
|
|||||||
|
|
||||||
a = a[5:25]
|
a = a[5:25]
|
||||||
res(sumpd(a), 5, 25)
|
res(sumpd(a), 5, 25)
|
||||||
|
|
||||||
|
a = a[30:95]
|
||||||
|
res(sumpd(a), 35, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
// call ptr fixed with ptr fixed
|
// call ptr fixed with ptr fixed
|
||||||
|
Loading…
Reference in New Issue
Block a user