OSDN Git Service

Update to current version of Go library (revision 94d654be2064).
[pf3gnuchains/gcc-fork.git] / libgo / go / sync / mutex_test.go
index d0e048e..f5c20ca 100644 (file)
@@ -89,3 +89,16 @@ func BenchmarkContendedMutex(b *testing.B) {
        <-c
        <-c
 }
+
+func TestMutexPanic(t *testing.T) {
+       defer func() {
+               if recover() == nil {
+                       t.Fatalf("unlock of unlocked mutex did not panic")
+               }
+       }()
+
+       var mu Mutex
+       mu.Lock()
+       mu.Unlock()
+       mu.Unlock()
+}