Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions tests/path-test.roc
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,6 @@ test_file_operations! = |{}|
"""
)?

# Test Path.delete!
delete_path = Path.from_str("test_to_delete.txt")
Path.write_utf8!("This file will be deleted", delete_path)?

# Verify file exists before deletion
ls_before = Cmd.new("ls") |> Cmd.args(["test_to_delete.txt"]) |> Cmd.output!()

Path.delete!(delete_path) ? |err| DeleteFailed(err)

# Verify file is gone after deletion
ls_after = Cmd.new("ls") |> Cmd.args(["test_to_delete.txt"]) |> Cmd.output!()

Stdout.line!(
"""
File exists before delete: ${Inspect.to_str(ls_before.status? == 0)}
File exists after delete: ${Inspect.to_str(ls_after.status? == 0)}
"""
)?

Ok({})

test_directory_operations! : {} => Result {} _
Expand Down Expand Up @@ -341,10 +322,6 @@ cleanup_test_files! = |{}|
${cleanup_stdout}
"""
)?

List.for_each_try!(test_files, |filename|
Path.delete!(Path.from_str(filename))
)?

# Verify cleanup
ls_after_cleanup = Cmd.new("ls") |> Cmd.args(test_files) |> Cmd.output!()
Expand All @@ -355,4 +332,4 @@ cleanup_test_files! = |{}|
"""
)
else
Stderr.line!("✗ Error listing files before cleanup: `ls -la ...` exited with non-zero exit code:\n\t${Inspect.to_str(ls_before_cleanup)}")
Stderr.line!("✗ Error listing files before cleanup: `ls -la ...` exited with non-zero exit code:\n\t${Inspect.to_str(ls_before_cleanup)}")
Loading