forked from astro/affection-rs
create window on test
This commit is contained in:
parent
6eb7c31406
commit
13c86a98d7
25
src/lib.rs
25
src/lib.rs
|
@ -42,10 +42,31 @@ pub fn run<C: Callbacks>(config: Config) {
|
|||
|
||||
#[cfg(test)]
|
||||
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]
|
||||
fn it_works() {
|
||||
let _config = Config::default();
|
||||
let config = Config::default();
|
||||
run::<TestCallbacks>(config);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue