diff --git a/tests/rust/wasm32-wasip3/src/bin/filesystem-hard-links.rs b/tests/rust/wasm32-wasip3/src/bin/filesystem-hard-links.rs index 433adbb7..6d52a9d9 100644 --- a/tests/rust/wasm32-wasip3/src/bin/filesystem-hard-links.rs +++ b/tests/rust/wasm32-wasip3/src/bin/filesystem-hard-links.rs @@ -29,7 +29,9 @@ async fn test_hard_links(dir: &Descriptor) { let rmdir = |path: &str| dir.remove_directory_at(path.to_string()); // link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - assert_eq!(ln(".", "foo").await, Err(ErrorCode::NotPermitted)); + assert!(matches!(ln(".", "foo").await, + Err(ErrorCode::NotPermitted | ErrorCode::Access))); + assert_eq!(ln("", "foo").await, Err(ErrorCode::NoEntry)); assert_eq!(ln("", "").await, Err(ErrorCode::NoEntry)); assert_eq!(ln("a.txt", "").await, Err(ErrorCode::NoEntry)); @@ -39,7 +41,7 @@ async fn test_hard_links(dir: &Descriptor) { assert_eq!(ln("a.txt", "/a.txt").await, Err(ErrorCode::NotPermitted)); assert_eq!(ln("..", "a.txt").await, Err(ErrorCode::NotPermitted)); assert_eq!(ln("a.txt", "..").await, Err(ErrorCode::NotPermitted)); - // FIXME: https://github.com/WebAssembly/wasi-filesystem/issues/191 + // FIXME: https://github.com/WebAssembly/WASI/issues/710 // assert_eq!(ln_follow("parent/foo", "a.txt").await, // Err(ErrorCode::NotPermitted)); assert_eq!(ln("parent/foo", "a.txt").await, @@ -51,9 +53,8 @@ async fn test_hard_links(dir: &Descriptor) { mkdir("d.cleanup").await.unwrap(); ln("a.txt", "d.cleanup/q.txt").await.unwrap(); rm("d.cleanup/q.txt").await.unwrap(); - // https://github.com/WebAssembly/wasi-filesystem/issues/184 - assert_eq!(ln("d.cleanup", "e.cleanup").await, - Err(ErrorCode::NotPermitted)); + assert!(matches!(ln("d.cleanup", "e.cleanup").await, + Err(ErrorCode::NotPermitted | ErrorCode::Access))); rmdir("d.cleanup").await.unwrap(); }