use nihility_listener::NihilityListener;
use tokio::spawn;
use tracing::info;

#[tokio::test]
async fn test_full() {
    nihility_log::init().expect("Failed to initialize logger");
    let mut listener =
        NihilityListener::init_from_file_config().expect("initialize NihilityListener failed");
    let mut receiver = listener.get_text_receiver();
    spawn(async move {
        listener.run().await.expect("Failed to start listener");
    });
    let mut result_count = 0;
    while let Ok(text) = receiver.recv().await {
        info!("asr result: {:?}", text);
        result_count += 1;
        if result_count > 10 {
            break;
        }
    }
}
