19 lines
351 B
Rust
19 lines
351 B
Rust
|
|
||
|
extern crate futures;
|
||
|
|
||
|
#[cfg(test)]
|
||
|
mod tests {
|
||
|
|
||
|
use futures::future::{ok, Future};
|
||
|
|
||
|
#[test]
|
||
|
fn hello_futures() {
|
||
|
let my_future = ok::<String, ()>("Hello".into())
|
||
|
.map(|hello| hello + ", Futures!");
|
||
|
|
||
|
let string_result = my_future.wait().unwrap();
|
||
|
|
||
|
assert_eq!(string_result, "Hello, Futures!");
|
||
|
}
|
||
|
}
|