Add integration test
This commit is contained in:
23
tests/integration.rs
Normal file
23
tests/integration.rs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
use std::net::{TcpListener};
|
||||||
|
|
||||||
|
use std::io::Read;
|
||||||
|
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn it_works() {
|
||||||
|
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
|
||||||
|
|
||||||
|
let mut stream = listener.accept().unwrap().0;
|
||||||
|
|
||||||
|
let mut buf: [u8; 128] = [0; 128];
|
||||||
|
stream.read(&mut buf).unwrap();
|
||||||
|
|
||||||
|
for x in buf {
|
||||||
|
print!("{x}, ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user