mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
fix keymap macros. rendering issue
This commit is contained in:
parent
6f51872856
commit
f3fd88a199
15 changed files with 303 additions and 180 deletions
|
|
@ -7,29 +7,29 @@ mod edn_layout; pub use self::edn_layout::*;
|
|||
mod edn_token; pub use self::edn_token::*;
|
||||
|
||||
#[cfg(test)] #[test] fn test_edn () -> Result<(), ParseError> {
|
||||
use Item::*;
|
||||
assert_eq!(Item::read_all("")?,
|
||||
use EdnItem::*;
|
||||
assert_eq!(EdnItem::read_all("")?,
|
||||
vec![]);
|
||||
assert_eq!(Item::read_all(" ")?,
|
||||
assert_eq!(EdnItem::read_all(" ")?,
|
||||
vec![]);
|
||||
assert_eq!(Item::read_all("1234")?,
|
||||
assert_eq!(EdnItem::read_all("1234")?,
|
||||
vec![Num(1234)]);
|
||||
assert_eq!(Item::read_all("1234 5 67")?,
|
||||
assert_eq!(EdnItem::read_all("1234 5 67")?,
|
||||
vec![Num(1234), Num(5), Num(67)]);
|
||||
assert_eq!(Item::read_all("foo/bar")?,
|
||||
assert_eq!(EdnItem::read_all("foo/bar")?,
|
||||
vec![Key("foo/bar".into())]);
|
||||
assert_eq!(Item::read_all(":symbol")?,
|
||||
assert_eq!(EdnItem::read_all(":symbol")?,
|
||||
vec![Sym(":symbol".into())]);
|
||||
assert_eq!(Item::read_all(" foo/bar :baz 456")?,
|
||||
assert_eq!(EdnItem::read_all(" foo/bar :baz 456")?,
|
||||
vec![Key("foo/bar".into()), Sym(":baz".into()), Num(456)]);
|
||||
assert_eq!(Item::read_all(" (foo/bar :baz 456) ")?,
|
||||
assert_eq!(EdnItem::read_all(" (foo/bar :baz 456) ")?,
|
||||
vec![Exp(vec![Key("foo/bar".into()), Sym(":baz".into()), Num(456)])]);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)] #[test] fn test_edn_layout () -> Result<(), ParseError> {
|
||||
let source = include_str!("example.edn");
|
||||
let layout = Item::read_all(source)?;
|
||||
let layout = EdnItem::read_all(source)?;
|
||||
//panic!("{layout:?}");
|
||||
//let content = <dyn EdnLayout<::tek_engine::tui::Tui>>::from(&layout);
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue