Skip to content

Commit 24d6df0

Browse files
committed
Relax hard-link test error assertions
Fixes #177.
1 parent 932f7c0 commit 24d6df0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tests/rust/wasm32-wasip3/src/bin/filesystem-hard-links.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ async fn test_hard_links(dir: &Descriptor) {
2929
let rmdir = |path: &str| dir.remove_directory_at(path.to_string());
3030

3131
// link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow<descriptor>, new-path: string) -> result<_, error-code>;
32-
assert_eq!(ln(".", "foo").await, Err(ErrorCode::NotPermitted));
32+
assert!(matches!(ln(".", "foo").await,
33+
Err(ErrorCode::NotPermitted | ErrorCode::Access)));
34+
3335
assert_eq!(ln("", "foo").await, Err(ErrorCode::NoEntry));
3436
assert_eq!(ln("", "").await, Err(ErrorCode::NoEntry));
3537
assert_eq!(ln("a.txt", "").await, Err(ErrorCode::NoEntry));
@@ -39,7 +41,7 @@ async fn test_hard_links(dir: &Descriptor) {
3941
assert_eq!(ln("a.txt", "/a.txt").await, Err(ErrorCode::NotPermitted));
4042
assert_eq!(ln("..", "a.txt").await, Err(ErrorCode::NotPermitted));
4143
assert_eq!(ln("a.txt", "..").await, Err(ErrorCode::NotPermitted));
42-
// FIXME: https://github.com/WebAssembly/wasi-filesystem/issues/191
44+
// FIXME: https://github.com/WebAssembly/WASI/issues/710
4345
// assert_eq!(ln_follow("parent/foo", "a.txt").await,
4446
// Err(ErrorCode::NotPermitted));
4547
assert_eq!(ln("parent/foo", "a.txt").await,
@@ -51,9 +53,8 @@ async fn test_hard_links(dir: &Descriptor) {
5153
mkdir("d.cleanup").await.unwrap();
5254
ln("a.txt", "d.cleanup/q.txt").await.unwrap();
5355
rm("d.cleanup/q.txt").await.unwrap();
54-
// https://github.com/WebAssembly/wasi-filesystem/issues/184
55-
assert_eq!(ln("d.cleanup", "e.cleanup").await,
56-
Err(ErrorCode::NotPermitted));
56+
assert!(matches!(ln("d.cleanup", "e.cleanup").await,
57+
Err(ErrorCode::NotPermitted | ErrorCode::Access)))
5758
rmdir("d.cleanup").await.unwrap();
5859
}
5960

0 commit comments

Comments
 (0)