Add basic tests for getFileInfo.
This commit is contained in:
parent
d9e545bf60
commit
c38d181670
|
@ -5,6 +5,7 @@
|
|||
module test;
|
||||
|
||||
import vibe.core.file;
|
||||
import std.exception;
|
||||
|
||||
enum ubyte[] bytes(BYTES...) = [BYTES];
|
||||
|
||||
|
@ -32,5 +33,15 @@ void main()
|
|||
assert(dst[] == bytes!(3, 4, 5, 6, 7));
|
||||
f.close();
|
||||
|
||||
auto fi = getFileInfo("test.dat");
|
||||
assert(fi.name == "test.dat");
|
||||
assert(fi.isFile);
|
||||
assert(!fi.isDirectory);
|
||||
assert(!fi.isSymlink);
|
||||
assert(!fi.hidden);
|
||||
assert(fi.size == 10);
|
||||
|
||||
assertThrown(getFileInfo("*impossible:file?"));
|
||||
|
||||
removeFile("test.dat");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue