Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-babichenko committed Nov 17, 2024
1 parent 80e58e9 commit 81ee0b2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/tmux.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{env, process::Command, thread::sleep, time::Duration};
use std::{env, io::Read, process::Command, time::Duration};

use expectrl::Session;
use tempfile::NamedTempFile;
Expand All @@ -22,16 +22,19 @@ fn fixed() {
let mut p = Session::spawn(tmux).expect("Failed to spawn tmux");

p.send_line("eval \"$(fixit init bash)\"").unwrap();

p.set_expect_timeout(Some(Duration::from_secs(5)));

p.send_line("export SHELL=bash").unwrap();
p.send_line("eco 'Hello, world!'").unwrap();
p.send_line("FIXIT_LOG='fixit::get_text=debug' fix")
.unwrap();
p.send_line("").unwrap();
sleep(Duration::from_secs(1));
p.expect("got tmux output").unwrap();
p.expect("got fast output").unwrap();
p.expect("Hello, world!").unwrap();
// p.expect("got tmux output").unwrap();
// p.expect("got fast output").unwrap();
// p.expect("Hello, world!").unwrap();
p.send_line("exit").unwrap();
let mut buf = String::new();
p.read_to_string(&mut buf).unwrap();
println!("{}", buf);
}

0 comments on commit 81ee0b2

Please sign in to comment.