Skip to content

Commit e3929a4

Browse files
committed
Improve test for environment variables
1 parent 1442917 commit e3929a4

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tests/rust/wasm32-wasip3/src/bin/cli-env.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ export!(Component);
55

66
fn test_get_environment() {
77
let env = environment::get_environment();
8-
assert_eq!(
9-
env,
10-
vec![("foo".into(), "bar".into()), ("baz".into(), "42".into())]
11-
);
8+
assert_eq!(env.len(), 2);
9+
10+
for (k, v) in env {
11+
match k.as_str() {
12+
"foo" => assert_eq!(v, "bar"),
13+
"baz" => assert_eq!(v, "42"),
14+
unknown => panic!("Unexpected option {}", unknown)
15+
}
16+
}
1217
}
1318

1419
fn test_get_arguments() {

0 commit comments

Comments
 (0)