OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.19.4
/
src
/
testing
/
fstest
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
mapfs.go
6.97 KB
12/01/2022 06:13:01 PM
rw-r--r--
📄
mapfs_test.go
1.01 KB
12/01/2022 06:13:01 PM
rw-r--r--
📄
testfs.go
16.41 KB
12/01/2022 06:13:01 PM
rw-r--r--
📄
testfs_test.go
814 bytes
12/01/2022 06:13:01 PM
rw-r--r--
Editing: testfs_test.go
Close
// Copyright 2021 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 fstest import ( "internal/testenv" "os" "path/filepath" "testing" ) func TestSymlink(t *testing.T) { testenv.MustHaveSymlink(t) tmp := t.TempDir() tmpfs := os.DirFS(tmp) if err := os.WriteFile(filepath.Join(tmp, "hello"), []byte("hello, world\n"), 0644); err != nil { t.Fatal(err) } if err := os.Symlink(filepath.Join(tmp, "hello"), filepath.Join(tmp, "hello.link")); err != nil { t.Fatal(err) } if err := TestFS(tmpfs, "hello", "hello.link"); err != nil { t.Fatal(err) } } func TestDash(t *testing.T) { m := MapFS{ "a-b/a": {Data: []byte("a-b/a")}, } if err := TestFS(m, "a-b/a"); err != nil { t.Error(err) } }