1
0
mirror of https://github.com/golang/go synced 2024-07-05 09:50:19 +00:00

test: move map delete test to nil.go

No need for a separate test for this.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6941045
This commit is contained in:
Ian Lance Taylor 2012-12-13 12:11:24 -08:00
parent b2797f2ae0
commit 9509cbf203
2 changed files with 3 additions and 12 deletions

View File

@ -1,12 +0,0 @@
// run
// Copyright 2012 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.
package main
func main() {
var m map[int]int
delete(m, 0)
}

View File

@ -147,6 +147,9 @@ func maptest() {
panic(v)
}
// can delete (non-existent) entries
delete(m, 2)
// but cannot be written to
shouldPanic(func() {
m[2] = 3