Skip to content

Commit

Permalink
refactor: move all_keys_in_defsrc to test directory
Browse files Browse the repository at this point in the history
This file is incomplete and should not be encouraged for use as a
sample configuration. The configuration guide suggests to use
the primary reference of str_to_oscode instead.
  • Loading branch information
jtroo committed Jan 11, 2025
1 parent ee7215b commit bb3bdbf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
13 changes: 13 additions & 0 deletions parser/src/cfg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,19 @@ fn parse_multiline_comment() {
.unwrap();
}

#[test]
fn parse_all_keys() {
init_log();
let _lk = match CFG_PARSE_LOCK.lock() {
Ok(guard) => guard,
Err(poisoned) => poisoned.into_inner(),
};
new_from_file(&std::path::PathBuf::from(
"./test_cfgs/all_keys_in_defsrc.kbd",
))
.unwrap();
}

#[test]
fn parse_file_with_utf8_bom() {
let _lk = lock(&CFG_PARSE_LOCK);
Expand Down
1 change: 0 additions & 1 deletion parser/src/keys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ pub fn str_to_oscode(s: &str) -> Option<OsCode> {
"PrintScreen" | "prtsc" | "prnt" => OsCode::KEY_PRINT,

// NOTE: these are linux and interception-only due to missing implementation for LLHOOK.
// Unknown: is macOS supported? I haven't reviewed.
"mlft" | "mouseleft" | "🖰1" | "‹🖰" => OsCode::BTN_LEFT,
"mrgt" | "mouseright" | "🖰2" | "🖰›" => OsCode::BTN_RIGHT,
"mmid" | "mousemid" | "🖰3" => OsCode::BTN_MIDDLE,
Expand Down
File renamed without changes.
13 changes: 0 additions & 13 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,6 @@ fn parse_f13_f24() {
new_from_file(&std::path::PathBuf::from("./cfg_samples/f13_f24.kbd")).unwrap();
}

#[test]
fn parse_all_keys() {
init_log();
let _lk = match CFG_PARSE_LOCK.lock() {
Ok(guard) => guard,
Err(poisoned) => poisoned.into_inner(),
};
new_from_file(&std::path::PathBuf::from(
"./cfg_samples/all_keys_in_defsrc.kbd",
))
.unwrap();
}

#[test]
fn parse_home_row_mods() {
init_log();
Expand Down

0 comments on commit bb3bdbf

Please sign in to comment.