mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 19:56:44 +01:00
This commit is contained in:
parent
0621793930
commit
e3e3c163da
12 changed files with 104 additions and 182 deletions
28
input/input_test.rs
Normal file
28
input/input_test.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use crate::*;
|
||||
|
||||
#[test] fn test_stub_input () -> Usually<()> {
|
||||
use crate::*;
|
||||
struct TestInput(bool);
|
||||
enum TestEvent { Test1 }
|
||||
impl Input for TestInput {
|
||||
type Event = TestEvent;
|
||||
type Handled = ();
|
||||
fn event (&self) -> &Self::Event {
|
||||
&TestEvent::Test1
|
||||
}
|
||||
fn is_done (&self) -> bool {
|
||||
self.0
|
||||
}
|
||||
fn done (&self) {}
|
||||
}
|
||||
let _ = TestInput(true).event();
|
||||
assert!(TestInput(true).is_done());
|
||||
assert!(!TestInput(false).is_done());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
//#[cfg(all(test, feature = "dsl"))] #[test] fn test_dsl_keymap () -> Usually<()> {
|
||||
//let _keymap = CstIter::new("");
|
||||
//Ok(())
|
||||
//}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue