OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [os/] [exec/] [lp_test.go] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package exec
6
 
7
import (
8
        "testing"
9
)
10
 
11
var nonExistentPaths = []string{
12
        "some-non-existent-path",
13
        "non-existent-path/slashed",
14
}
15
 
16
func TestLookPathNotFound(t *testing.T) {
17
        for _, name := range nonExistentPaths {
18
                path, err := LookPath(name)
19
                if err == nil {
20
                        t.Fatalf("LookPath found %q in $PATH", name)
21
                }
22
                if path != "" {
23
                        t.Fatalf("LookPath path == %q when err != nil", path)
24
                }
25
                perr, ok := err.(*Error)
26
                if !ok {
27
                        t.Fatal("LookPath error is not an exec.Error")
28
                }
29
                if perr.Name != name {
30
                        t.Fatalf("want Error name %q, got %q", name, perr.Name)
31
                }
32
        }
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.