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

Side by Side Diff: src/pkg/exec/lp_test.go

Issue 4001048: code review 4001048: log: rename Exit* to Fatal* (Closed)
Patch Set: code review 4001048: log: rename Exit* to Fatal* Created 14 years, 1 month ago
Left:
Right:
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 unified diff | Download patch
« no previous file with comments | « src/cmd/godoc/main.go ('k') | src/pkg/http/server.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package exec 5 package exec
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 ) 9 )
10 10
11 var nonExistentPaths = []string{ 11 var nonExistentPaths = []string{
12 "some-non-existent-path", 12 "some-non-existent-path",
13 "non-existent-path/slashed", 13 "non-existent-path/slashed",
14 } 14 }
15 15
16 func TestLookPathNotFound(t *testing.T) { 16 func TestLookPathNotFound(t *testing.T) {
17 for _, name := range nonExistentPaths { 17 for _, name := range nonExistentPaths {
18 path, err := LookPath(name) 18 path, err := LookPath(name)
19 if err == nil { 19 if err == nil {
20 t.Fatalf("LookPath found %q in $PATH", name) 20 t.Fatalf("LookPath found %q in $PATH", name)
21 } 21 }
22 if path != "" { 22 if path != "" {
23 t.Fatalf("LookPath path == %q when err != nil", path) 23 t.Fatalf("LookPath path == %q when err != nil", path)
24 } 24 }
25 perr, ok := err.(*PathError) 25 perr, ok := err.(*PathError)
26 if !ok { 26 if !ok {
27 t.Fatal("LookPath error is not a PathError") 27 t.Fatal("LookPath error is not a PathError")
28 } 28 }
29 if perr.Name != name { 29 if perr.Name != name {
30 » » » t.Fatal("want PathError name %q, got %q", name, perr.Nam e) 30 » » » t.Fatalf("want PathError name %q, got %q", name, perr.Na me)
31 } 31 }
32 } 32 }
33 } 33 }
OLDNEW
« no previous file with comments | « src/cmd/godoc/main.go ('k') | src/pkg/http/server.go » ('j') | no next file with comments »

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