Skip to content

Commit

Permalink
Add test for non-existent file.
Browse files Browse the repository at this point in the history
  • Loading branch information
quelgar committed Jan 12, 2024
1 parent 450f518 commit f27edda
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/scala/scalauv/FileSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ final class FileSpec {

}

@Test
def readNonExistentFileReturnsError() = {
val loop = uv_default_loop()
val result = UvUtils.FsReq
.use { openReq =>
uv_fs_open(
loop,
openReq,
c"i_do_not_exist.fake",
FileOpenFlags.O_RDONLY,
0,
null
)
}

assertEquals("error code", ErrorCodes.ENOENT, result)
}

@Test
def writeNewFile(): Unit = {
val text = "my country is the world, and my religion is to do good"
Expand Down

0 comments on commit f27edda

Please sign in to comment.