nyaa 0.9.0

A tui tool for browsing and downloading torrents from nyaa.si
Documentation
use ratatui::buffer::Buffer;

use crate::common::{reset_buffer, run_app, EventBuilder};

#[allow(dead_code)]
mod common;

#[tokio::test]
async fn test_search() {
    let sync = EventBuilder::new()
        .string("/one punch man")
        .esc()
        .string('c')
        .quit()
        .build();

    let res = reset_buffer(&run_app(sync, 60, 22).await.unwrap());

    assert_eq!(
        res,
        Buffer::with_lines([
            "┌Search──────────────────────────────Press F1 or ? for help┐",
            "│one punch man                                             │",
            "└──────────────────────────────────────────────────────────┘",
            "┌Results 1-0 (0 total): Page 1/0─dl: Run Command, src: Nyaa┐",
            "│            ┌Category───────────────────────┐             │",
            "│            │ ▼ All Categories              │             │",
            "│            │  --- All Categories          █             │",
            "│            │ ▶ Anime                       █             │",
            "│            │ ▶ Audio                       █             │",
            "│            │ ▶ Literature                  █             │",
            "│            │ ▶ Live Action                 █             │",
            "│            │ ▶ Pictures                    █             │",
            "│            │ ▶ Software                    █             │",
            "│            │                               │             │",
            "│            │                               │             │",
            "│            │                               │             │",
            "│            │                               │             │",
            "│            └───────────────────────────────┘             │",
            "│                                                          │",
            "│                                                          │",
            "│                                                          │",
            "└─────────────────────────────────────────────────────────c┘",
        ])
    );
}