From c38d1816708a07d8f0a30b83c59d08a1cea3b690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 25 Aug 2019 14:09:59 +0200 Subject: [PATCH] Add basic tests for getFileInfo. --- tests/vibe.core.file.d | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/vibe.core.file.d b/tests/vibe.core.file.d index 254b684..1da05fa 100644 --- a/tests/vibe.core.file.d +++ b/tests/vibe.core.file.d @@ -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"); }