diff --git a/src/lib.rs b/src/lib.rs index 320711a..9413012 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,27 +10,3 @@ pub mod prelude { } pub use platforms::*; - -#[cfg(test)] -mod tests { - use super::prelude::*; - use super::*; - - #[test] - fn connect_to_wifi_failed() { - let config = Some(Config { - interface: Some("wlo1"), - }); - - let mut wifi = WiFi::new(config); - - assert_eq!(wifi.connect("ssid", "password").unwrap(), false); - } - - #[test] - fn create_hotspot() { - let hotspot_created = WiFi::create_hotspot("hello", "hi").unwrap(); - - assert_eq!(hotspot_created, true); - } -} diff --git a/tests/mod.rs b/tests/mod.rs new file mode 100644 index 0000000..1d9dd35 --- /dev/null +++ b/tests/mod.rs @@ -0,0 +1,20 @@ +extern crate wifi_rs; +use self::wifi_rs::{prelude::*, Config, WiFi}; + +#[test] +fn connect_to_wifi_failed() { + let config = Some(Config { + interface: Some("wlo1"), + }); + + let mut wifi = WiFi::new(config); + + assert_eq!(wifi.connect("ssid", "password").unwrap(), false); +} + +#[test] +fn create_hotspot() { + let hotspot_created = WiFi::create_hotspot("hello", "hi").unwrap(); + + assert_eq!(hotspot_created, true); +}