forked from lavina/lavina
Compare commits
No commits in common. "7efbea7b71971ed5be4b27893de383408353872d" and "1e8a183d6c1af0775f63b784ed0a33fa2e70b651" have entirely different histories.
7efbea7b71
...
1e8a183d6c
|
@ -104,7 +104,6 @@ struct TestServer {
|
|||
core: LavinaCore,
|
||||
server: RunningServer,
|
||||
}
|
||||
|
||||
impl TestServer {
|
||||
async fn start() -> Result<TestServer> {
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
@ -188,55 +187,6 @@ async fn scenario_basic() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn scenario_basic_with_chathistory() -> Result<()> {
|
||||
let server = TestServer::start().await?;
|
||||
|
||||
// test scenario
|
||||
|
||||
server.core.create_player(&PlayerId::from("tester")?).await?;
|
||||
server.core.set_password("tester", "password").await?;
|
||||
|
||||
let mut stream = TcpStream::connect(server.server.addr).await?;
|
||||
let mut s = TestScope::new(&mut stream);
|
||||
|
||||
s.send("PASS password").await?;
|
||||
s.send("NICK tester").await?;
|
||||
s.send("USER UserName 0 * :Real Name").await?;
|
||||
s.expect_server_introduction("tester").await?;
|
||||
s.expect_nothing().await?;
|
||||
|
||||
s.send("JOIN #test").await?;
|
||||
s.expect(":tester JOIN #test").await?;
|
||||
s.expect(":testserver 332 tester #test :New room").await?;
|
||||
s.expect(":testserver 353 tester = #test :tester").await?;
|
||||
s.expect(":testserver 366 tester #test :End of /NAMES list").await?;
|
||||
s.send("PRIVMSG #test :Message1").await?;
|
||||
s.send("PRIVMSG #test :Message2").await?;
|
||||
s.send("PRIVMSG #test :Message3").await?;
|
||||
s.send("PRIVMSG #test :Message4").await?;
|
||||
|
||||
s.send("CHATHISTORY LATEST #test * 1").await?;
|
||||
s.expect(":tester PRIVMSG #test :Message4").await?;
|
||||
|
||||
s.send("CHATHISTORY LATEST #test * 3").await?;
|
||||
s.expect(":tester PRIVMSG #test :Message2").await?;
|
||||
s.expect(":tester PRIVMSG #test :Message3").await?;
|
||||
s.expect(":tester PRIVMSG #test :Message4").await?;
|
||||
s.expect_nothing().await?;
|
||||
|
||||
s.send("QUIT :Leaving").await?;
|
||||
s.expect(":testserver ERROR :Leaving the server").await?;
|
||||
s.expect_eof().await?;
|
||||
|
||||
stream.shutdown().await?;
|
||||
|
||||
// wrap up
|
||||
|
||||
server.shutdown().await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn scenario_join_and_reboot() -> Result<()> {
|
||||
let server = TestServer::start().await?;
|
||||
|
|
Loading…
Reference in New Issue