Skip to content

Commit

Permalink
add: sample tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luftaquila committed Apr 19, 2024
1 parent fa8d2ae commit c391f92
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bin/transistor-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ fn main() -> Result<(), Error> {
println!("[INF] client startup! server: {}", &args[1]);

let client = Client::new()?;
let mut client = client.borrow_mut();

/* generate client.json */
let path = client.borrow().to_json()?;
let path = client.to_json()?;

println!("[INF] add generated client config to the server's config.json");
println!("client.json: {}", path.as_os_str().to_str().unwrap());

/* connect to server and transfer client info */
client.borrow_mut().connect(&args[1])?;
client.connect(&args[1])?;

client.borrow().listen()?;
client.listen()?;

loop {}

Expand Down
14 changes: 14 additions & 0 deletions tests/get_displays.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#[test]
fn print_display_list() {
transistor::print_displays();
}

#[test]
fn create_server() {
let server = transistor::Server::new(2426);
}

#[test]
fn create_client() {
let client = transistor::Client::new();
}

0 comments on commit c391f92

Please sign in to comment.