create window on test

This commit is contained in:
Nek0 - 2020-03-10 05:19:23 +01:00
parent 6eb7c31406
commit 13c86a98d7

View File

@ -42,10 +42,31 @@ pub fn run<C: Callbacks>(config: Config) {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::Config; use super::{Config, Callbacks, Event, Graphics};
use crate::run;
struct TestCallbacks {
}
impl Callbacks for TestCallbacks {
fn load_state() -> Self {
TestCallbacks{
}
}
//fn preLoop(&mut self){}
fn handle_event(&mut self, ev: Event){
}
fn update(&mut self){
}
fn draw(&self, graphics: &mut Graphics){
}
fn clean_up(self){
}
}
#[test] #[test]
fn it_works() { fn it_works() {
let _config = Config::default(); let config = Config::default();
run::<TestCallbacks>(config);
} }
} }