1
0
Fork 0
forked from wry/wry
wry/src/it/tests/t0017_remove_unused_ws.rs
2022-05-17 17:47:01 +02:00

35 lines
812 B
Rust

use {
crate::it::{test_error::TestResult, testrun::TestRun},
std::rc::Rc,
};
testcase!();
async fn test(run: Rc<TestRun>) -> TestResult {
let ds = run.create_default_setup().await?;
run.cfg.show_workspace(ds.seat.id(), "1")?;
tassert_eq!(run.state.workspaces.len(), 1);
run.cfg.show_workspace(ds.seat.id(), "2")?;
tassert_eq!(run.state.workspaces.len(), 1);
run.cfg.show_workspace(ds.seat.id(), "1")?;
tassert_eq!(run.state.workspaces.len(), 1);
let client = run.create_client().await?;
let win = client.create_window().await?;
win.map().await?;
run.cfg.show_workspace(ds.seat.id(), "2")?;
tassert_eq!(run.state.workspaces.len(), 2);
run.cfg.show_workspace(ds.seat.id(), "1")?;
tassert_eq!(run.state.workspaces.len(), 1);
Ok(())
}