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 Jun 25, 2024
1 parent 02d27c1 commit 901761a
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 901761a

Please sign in to comment.