mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-07 12:16:44 +01:00
core, input, output, dsl: factor away 'flexi' traits
This commit is contained in:
parent
8cbd7dd8e8
commit
9f7d0efda5
11 changed files with 355 additions and 339 deletions
28
input/src/input_test.rs
Normal file
28
input/src/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