You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.5 KiB

---
test case: file exists
files:
file.txt: |
123456
in:
key: "vfs.file.exists[file.txt]"
out:
result: SYSINFO_RET_OK
file_exists: 1
---
test case: file exists, include all
files:
file.txt: |
123456
in:
key: "vfs.file.exists[file.txt, all]"
out:
result: SYSINFO_RET_OK
file_exists: 1
---
test case: file exists, exclude sockets
files:
file.txt: |
123456
in:
key: "vfs.file.exists[file.txt,, sock]"
out:
result: SYSINFO_RET_OK
file_exists: 1
---
test case: file does not exist
files:
file.txt: |
123456
in:
key: "vfs.file.exists[nonexistent.txt]"
out:
result: SYSINFO_RET_OK
file_exists: 0
---
test case: file exist but is excluded
files:
file.txt: |
123456
in:
key: "vfs.file.exists[file.txt,, file]"
out:
result: SYSINFO_RET_OK
file_exists: 0
---
test case: empty file name
in:
key: "vfs.file.exists[]"
out:
result: SYSINFO_RET_FAIL
error: "Invalid first parameter."
---
test case: too many parameters
in:
key: "vfs.file.exists[foo, bar, buz, qux]"
out:
result: SYSINFO_RET_FAIL
error: "Too many parameters."
---
test case: invalid "include types" parameter
in:
key: "vfs.file.exists[foo, bar]"
out:
result: SYSINFO_RET_FAIL
error: "Invalid type \"bar\"."
---
test case: invalid "exclude types" parameter
in:
key: "vfs.file.exists[foo, file, baz]"
out:
result: SYSINFO_RET_FAIL
error: "Invalid type \"baz\"."
---
test case: invalid both "include types" and "exclude types" parameters
in:
key: "vfs.file.exists[foo, bar, baz]"
out:
result: SYSINFO_RET_FAIL
error: "Invalid type \"bar\"."
...