INNER CODE UNIT · Rust
maps_editing_commands
keon/browser-control · src/actions.rs:316
fn maps_editing_commands() {
assert_eq!(editing_command(2, "a"), Some("selectAll"));
assert_eq!(editing_command(4, "A"), Some("selectAll"));
assert_eq!(editing_command(4 | 8, "z"), Some("redo"));
assert_eq!(editing_command(2, "z"), Some("undo"));
assert_eq!(editing_command(8, "a"), None); // shift alone is typing
assert_eq!(editing_command(2, "q"), None);
}
#[test]
fn ref_targets_become_attribute_selectors() {
assert_eq!(ref_selector("@e3"), r#"[data-browser-control-ref="e3"]"#);
assert_eq!(ref_selector("#submit"), "#submit");
}
}