Skip to content

Commit

Permalink
add check for expected contents
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewilliamboswell committed Nov 22, 2023
1 parent b2572a9 commit 9d60e91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/dir.roc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ main =
createChildShouldSucceed == Ok {}

# List the contents of a directory
_ <-
paths <-
Path.fromStr "a"
|> Dir.list
|> Dir.list
|> Task.onErr \_ -> crash "Failed to list directory"
|> Task.await

# Check the contents of the directory
expect
(List.map paths Path.display) == ["b", "child"]

# Try to create a directory without a parent
createWithoutParentShouldFail <- Task.attempt (Dir.create (Path.fromStr "d/child"))
expect
Expand Down

0 comments on commit 9d60e91

Please sign in to comment.