-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfile_test.go
More file actions
32 lines (24 loc) · 825 Bytes
/
file_test.go
File metadata and controls
32 lines (24 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-FileCopyrightText: 2014-2024 caixw
//
// SPDX-License-Identifier: MIT
package assert
import (
"os"
"testing"
)
func TestAssertion_FileExists_FileNotExists(t *testing.T) {
a := New(t, false)
a.FileExists("./assert.go", "a.FileExists(./assert.go) failed").
FileNotExists("c:/win", "a.FileNotExists(c:/win) failed")
fsys := os.DirFS("./")
a.FileExistsFS(fsys, "assert.go", "a.FileExistsFS(./assert) failed").
FileNotExistsFS(fsys, "win", "a.FileNotExistsFS(c:/win) failed")
}
func TestAssertion_IsDir_IsNotDir(t *testing.T) {
a := New(t, false)
a.IsDir("./rest", "a.IsDir(./rest) failed").
IsNotDir("./assert.go", "a.IsNotDir(./assert.go) failed")
fsys := os.DirFS("./")
a.IsDirFS(fsys, "rest", "a.IsDirFS(./rest) failed").
IsNotDirFS(fsys, "./assert.go", "a.IsNotDirFS(./assert.go) failed")
}