Skip to content

Commit

Permalink
Add test for FileSystem.readDirectory error
Browse files Browse the repository at this point in the history
If the directory doesn't exist, the function is expected to throw.
  • Loading branch information
tobil4sk committed Mar 7, 2024
1 parent 52888e2 commit 1aa9726
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/sys/src/TestFileSystem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ class TestFileSystem extends utest.Test {
//read directory with complex path
Assert.isTrue(FileSystem.readDirectory("../sys/./.." + tailingSlash).indexOf("sys") > -1);
}
// should throw if directory doesn't exist
try {
FileSystem.readDirectory("non-existant");
Assert.isFalse(true);
} catch (_) {
Assert.isTrue(true);
}
}

function testCreateDirectory():Void {
Expand Down

0 comments on commit 1aa9726

Please sign in to comment.