@@ -160,7 +160,7 @@ test_file_operations! = |{}|
160160 # Verify file exists before deletion
161161 _ = Cmd.exec!(" test" , [" - e" , " test_to_delete. txt " ])?
162162
163- Path.delete!(delete_path) ? |err| DeleteFailed(err)
163+ Path.delete!(delete_path) ? DeleteFailed
164164
165165 # Verify file is gone after deletion
166166 exists_after_res = Cmd.exec!(" test" , [" - e" , " test_to_delete. txt " ])
@@ -342,7 +342,7 @@ test_path_rename! = |{}|
342342 new_path = Path . from_str ("test_path_rename_new .txt ")
343343 test_file_content = " Content for rename test."
344344
345- Path . write_utf8 !(test_file_content , original_path) ? |err| WriteOriginalFailed (err)
345+ Path . write_utf8 !(test_file_content , original_path) ? WriteOriginalFailed
346346
347347 # Rename the file
348348 when Path . rename !(original_path , new_path) is
@@ -357,12 +357,12 @@ test_path_rename! = |{}|
357357 else
358358 Stdout.line!(" ✓ Original file no longer exists" )?
359359
360- new_file_exists = Path.is_file!(new_path) ? |err| NewIsFileFailed(err)
360+ new_file_exists = Path.is_file!(new_path) ? NewIsFileFailed
361361
362362 if new_file_exists then
363363 Stdout.line!(" ✓ Renamed file exists" )?
364364
365- content = Path.read_utf8!(new_path) ? |err| NewFileReadFailed(err)
365+ content = Path.read_utf8!(new_path) ? NewFileReadFailed
366366
367367 if content == test_file_content then
368368 Stdout.line!(" ✓ Renamed file has correct content" )
@@ -382,7 +382,7 @@ test_path_exists! = |{}|
382382 filename = Path . from_str ("test_path_exists .txt ")
383383 Path . write_utf8 !("This file exists" , filename)?
384384
385- file_exists = Path.exists!(filename) ? |err| PathExistsCheckFailed(err)
385+ file_exists = Path.exists!(filename) ? PathExistsCheckFailed
386386
387387 if file_exists then
388388 Stdout.line!(" ✓ Path . exists ! returns true for a file that exists" )?
@@ -392,7 +392,7 @@ test_path_exists! = |{}|
392392 # Test that a file that does not exist returns false
393393 Path.delete!(filename)?
394394
395- file_exists_after_delete = Path.exists!(filename) ? |err| PathExistsCheckAfterDeleteFailed(err)
395+ file_exists_after_delete = Path.exists!(filename) ? PathExistsCheckAfterDeleteFailed
396396
397397 if file_exists_after_delete then
398398 Stderr.line!(" ✗ Path . exists ! returned true for a file that does not exist" )?
@@ -422,23 +422,23 @@ test_is_sym_link! = |{}|
422422 ln_dir_result = Cmd.new(" ln" ) |> Cmd.args([" - s" , " test_directory" , " test_symlink_to_dir" ]) |> Cmd.exec_output!()
423423
424424 # Test is_sym_link on regular file
425- regular_is_symlink = Path.is_sym_link!(regular_file) ? |err| RegularFileSymlinkCheckFailed(err)
425+ regular_is_symlink = Path.is_sym_link!(regular_file) ? RegularFileSymlinkCheckFailed
426426
427427 # Test is_sym_link on directory
428- dir_is_symlink = Path.is_sym_link!(test_dir) ? |err| DirSymlinkCheckFailed(err)
428+ dir_is_symlink = Path.is_sym_link!(test_dir) ? DirSymlinkCheckFailed
429429
430430 # Test is_sym_link on symbolic links (if creation succeeded)
431431 file_link_is_symlink =
432432 when ln_file_result is
433433 Ok(_) ->
434- Path.is_sym_link!(link_to_file) ? |err| FileLinkSymlinkCheckFailed(err)
434+ Path.is_sym_link!(link_to_file) ? FileLinkSymlinkCheckFailed
435435 Err(_) ->
436436 Bool.false
437437
438438 dir_link_is_symlink =
439439 when ln_dir_result is
440440 Ok(_) ->
441- Path.is_sym_link!(link_to_dir) ? |err| DirLinkSymlinkCheckFailed(err)
441+ Path.is_sym_link!(link_to_dir) ? DirLinkSymlinkCheckFailed
442442 Err(_) ->
443443 Bool.false
444444
@@ -480,16 +480,16 @@ test_path_type! = |{}|
480480 ln_result = Cmd.new(" ln" ) |> Cmd.args([" - s" , " test_type_file. txt " , " test_type_symlink. txt " ]) |> Cmd.exec_output!()
481481
482482 # Test type on regular file
483- file_type = Path.type!(regular_file) ? |err| FileTypeCheckFailed(err)
483+ file_type = Path.type!(regular_file) ? FileTypeCheckFailed
484484
485485 # Test type on directory
486- dir_type = Path.type!(test_dir) ? |err| DirTypeCheckFailed(err)
486+ dir_type = Path.type!(test_dir) ? DirTypeCheckFailed
487487
488488 # Test type on symbolic link (if creation succeeded)
489489 symlink_type =
490490 when ln_result is
491491 Ok(_) ->
492- Path.type!(symlink_path) ? |err| SymlinkTypeCheckFailed(err)
492+ Path.type!(symlink_path) ? SymlinkTypeCheckFailed
493493 Err(_) ->
494494 IsFile
495495
@@ -542,7 +542,7 @@ cleanup_test_files! = |files_requirement|
542542
543543 when files_requirement is
544544 FilesNeedToExist ->
545- delete_result ? |err| PathDeletionFailed(err)
545+ delete_result ? PathDeletionFailed
546546 FilesMaybeExist ->
547547 Ok({})?
548548
0 commit comments