Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Unified Diff: src/pkg/exp/exception/exception_test.go

Issue 857048: code review 857048: Remove exp/exception as it's no longer relevant (Closed)
Patch Set: code review 857048: Remove exp/exception as it's no longer relevant Created 14 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/exp/exception/exception.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/exp/exception/exception_test.go
===================================================================
deleted file mode 100644
--- a/src/pkg/exp/exception/exception_test.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2009 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 exception
-
-import "testing"
-
-func TestNoException(t *testing.T) {
- e := Try(func(throw Handler) {})
- if e != nil {
- t.Fatalf("no exception expected, found: %v", e)
- }
-}
-
-
-func TestNilException(t *testing.T) {
- e := Try(func(throw Handler) { throw(nil) })
- if e == nil {
- t.Fatalf("exception expected", e)
- }
- if e.Value != nil {
- t.Fatalf("nil exception expected, found: %v", e)
- }
-}
-
-
-func TestTry(t *testing.T) {
- s := 0
- for i := 1; i <= 10; i++ {
- e := Try(func(throw Handler) {
- if i%3 == 0 {
- throw(i)
- panic("throw returned")
- }
- })
- if e != nil {
- s += e.Value.(int)
- }
- }
- result := 3 + 6 + 9
- if s != result {
- t.Fatalf("expected: %d, found: %d", result, s)
- }
-}
-
-
-func TestCatch(t *testing.T) {
- s := 0
- for i := 1; i <= 10; i++ {
- Try(func(throw Handler) {
- if i%3 == 0 {
- throw(i)
- }
- }).Catch(func(x interface{}) { s += x.(int) })
- }
- result := 3 + 6 + 9
- if s != result {
- t.Fatalf("expected: %d, found: %d", result, s)
- }
-}
« no previous file with comments | « src/pkg/exp/exception/exception.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b