forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.rs
More file actions
30 lines (26 loc) · 853 Bytes
/
Copy pathtests.rs
File metadata and controls
30 lines (26 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! Runtime integration tests.
#[cfg(test)]
mod integration_tests {
use crate::runtime::Runtime;
use crate::types::Value;
#[test]
fn test_runtime_spawn_multiple_actors() {
let mut rt = Runtime::new();
let a1 = rt.spawn_actor(Value::int(0));
let a2 = rt.spawn_actor(Value::int(1));
let a3 = rt.spawn_actor(Value::int(2));
assert_ne!(a1.id, a2.id);
assert_ne!(a2.id, a3.id);
}
#[test]
fn test_supervisor_restarts() {
use crate::runtime::supervisor::{Supervisor, RestartPolicy, Strategy, ChildSpec};
use crate::runtime::actor::Addr;
use std::time::Duration;
let mut sup = Supervisor::new();
let addr = Addr::local(1);
sup.monitor(addr);
sup.handle_exit(addr, "normal");
assert_eq!(sup.actor_count(), 1);
}
}