use async_trait::async_trait;
use futures::StreamExt;
use strmline::{Progress, RevertProgress, State, Streamline};
use tokio::runtime::Runtime;
#[test]
fn completes_down() {
#[derive(Debug)]
struct Context;
#[allow(dead_code)]
#[derive(Clone, Debug, PartialEq)]
enum MyState {
Start,
Middle(String),
End(String),
}
impl Default for MyState {
fn default() -> Self {
Self::Start
}
}
#[derive(Debug, PartialEq)]
struct MyError(&'static str);
#[async_trait(?Send)]
impl State for MyState {
type Context = Context;
type Error = MyError;
async fn next(
&self,
_context: Option<&Self::Context>,
) -> Result