diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /ui/keycodemapdb/tests/rust-test | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'ui/keycodemapdb/tests/rust-test')
-rw-r--r-- | ui/keycodemapdb/tests/rust-test/Cargo.toml | 10 | ||||
-rw-r--r-- | ui/keycodemapdb/tests/rust-test/src/main.rs | 28 |
2 files changed, 38 insertions, 0 deletions
diff --git a/ui/keycodemapdb/tests/rust-test/Cargo.toml b/ui/keycodemapdb/tests/rust-test/Cargo.toml new file mode 100644 index 000000000..832ac377e --- /dev/null +++ b/ui/keycodemapdb/tests/rust-test/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "rust-test" +version = "0.1.0" +authors = ["Marc-André Lureau <marcandre.lureau@redhat.com>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +phf = { version = "0.8", features = ["macros"] } diff --git a/ui/keycodemapdb/tests/rust-test/src/main.rs b/ui/keycodemapdb/tests/rust-test/src/main.rs new file mode 100644 index 000000000..ba165d03a --- /dev/null +++ b/ui/keycodemapdb/tests/rust-test/src/main.rs @@ -0,0 +1,28 @@ +include!("../../html2win32_name.rs"); +include!("../../html2win32.rs"); +include!("../../osx2win32_name.rs"); +include!("../../osx2win32.rs"); +include!("../../osx2xkb_name.rs"); +include!("../../osx2xkb.rs"); +include!("../../osx_name.rs"); +include!("../../osx.rs"); + +fn main() { + assert_eq!(CODE_MAP_OSX_TO_WIN32[0x1d], 0x30); + assert_eq!(NAME_MAP_OSX_TO_WIN32[0x1d], "VK_0"); + + assert_eq!(CODE_MAP_OSX_TO_XKB[0x1d], "AE10"); + assert_eq!(NAME_MAP_OSX_TO_XKB[0x1d], "AE10"); + + assert_eq!(CODE_MAP_HTML_TO_WIN32["ControlLeft"], 0x11); + assert_eq!(NAME_MAP_HTML_TO_WIN32["ControlLeft"], "VK_CONTROL"); + + assert_eq!(CODE_TABLE_OSX[0x1d], 0x3b); + assert_eq!(NAME_TABLE_OSX[0x1d], "Control"); +} + + +#[test] +fn test() { + main() +} |