Ereigniszustellung und Hostgrenzen korrigieren und Change archivieren
This commit is contained in:
2
tests/terminalfrei/.gitignore
vendored
Normal file
2
tests/terminalfrei/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/target
|
||||
/Cargo.lock
|
||||
13
tests/terminalfrei/Cargo.toml
Normal file
13
tests/terminalfrei/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "tb-terminalfrei-check"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
# Eigener Resolver: keine Feature-Unifikation mit CLI/IDE im Hauptworkspace.
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
tb-vm = { path = "../../crates/tb-vm" }
|
||||
tb-runtime = { path = "../../crates/tb-runtime" }
|
||||
tb-ui = { path = "../../crates/tb-ui" }
|
||||
29
tests/terminalfrei/src/main.rs
Normal file
29
tests/terminalfrei/src/main.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use tb_runtime::host::{CaptureHost, Ereignis, MausArt, MausEreignis};
|
||||
use tb_vm::interp::{RunEvent, Vm};
|
||||
|
||||
fn main() {
|
||||
let form = tb_ui::frm::read_text(
|
||||
"eingabe-taste-maus.frm",
|
||||
include_str!("../../compat/eingabe-taste-maus.frm"),
|
||||
)
|
||||
.unwrap();
|
||||
let module = tb_vm::compile_source_with_forms("FORM1", &form.code, &form.catalog()).unwrap();
|
||||
let mut vm = Vm::new(module);
|
||||
form.apply(&mut vm.forms).unwrap();
|
||||
vm.forms.show(0, false).unwrap();
|
||||
let mut host = CaptureHost::default();
|
||||
host.ereignis_nach(2, Ereignis::Taste("K".into(), 0));
|
||||
host.ereignis_nach(
|
||||
2,
|
||||
Ereignis::Maus(MausEreignis {
|
||||
art: MausArt::Druck,
|
||||
taste: 1,
|
||||
shift: 0,
|
||||
zeile: 2,
|
||||
spalte: 2,
|
||||
}),
|
||||
);
|
||||
assert_eq!(vm.run(&mut host), RunEvent::Ended);
|
||||
assert_eq!(tb_runtime::snapshot::text(&vm.rt.screen), "KM\n");
|
||||
println!("Terminalfreier FRM-/VM-Lauf: KM");
|
||||
}
|
||||
Reference in New Issue
Block a user