~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/os/path_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
package os_test
6
6
 
7
7
import (
 
8
        "io/ioutil"
8
9
        . "os"
9
10
        "path/filepath"
10
11
        "runtime"
167
168
 
168
169
func TestMkdirAllWithSymlink(t *testing.T) {
169
170
        if runtime.GOOS == "windows" || runtime.GOOS == "plan9" {
170
 
                t.Log("Skipping test: symlinks don't exist under Windows/Plan 9")
171
 
                return
172
 
        }
173
 
 
174
 
        tmpDir := TempDir()
 
171
                t.Skip("Skipping test: symlinks don't exist under Windows/Plan 9")
 
172
        }
 
173
 
 
174
        tmpDir, err := ioutil.TempDir("", "TestMkdirAllWithSymlink-")
 
175
        if err != nil {
 
176
                t.Fatal(err)
 
177
        }
 
178
        defer RemoveAll(tmpDir)
 
179
 
175
180
        dir := tmpDir + "/dir"
176
 
        err := Mkdir(dir, 0755)
 
181
        err = Mkdir(dir, 0755)
177
182
        if err != nil {
178
183
                t.Fatalf("Mkdir %s: %s", dir, err)
179
184
        }
180
 
        defer RemoveAll(dir)
181
185
 
182
186
        link := tmpDir + "/link"
183
187
        err = Symlink("dir", link)
184
188
        if err != nil {
185
189
                t.Fatalf("Symlink %s: %s", link, err)
186
190
        }
187
 
        defer RemoveAll(link)
188
191
 
189
192
        path := link + "/foo"
190
193
        err = MkdirAll(path, 0755)