Add basic tests for getFileInfo.

This commit is contained in:
Sönke Ludwig 2019-08-25 14:09:59 +02:00
parent d9e545bf60
commit c38d181670

View file

@ -5,6 +5,7 @@
module test; module test;
import vibe.core.file; import vibe.core.file;
import std.exception;
enum ubyte[] bytes(BYTES...) = [BYTES]; enum ubyte[] bytes(BYTES...) = [BYTES];
@ -32,5 +33,15 @@ void main()
assert(dst[] == bytes!(3, 4, 5, 6, 7)); assert(dst[] == bytes!(3, 4, 5, 6, 7));
f.close(); 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"); removeFile("test.dat");
} }