aboutsummaryrefslogtreecommitdiff
path: root/tests/rust-test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust-test')
-rw-r--r--tests/rust-test/Cargo.toml10
-rw-r--r--tests/rust-test/src/main.rs23
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/rust-test/Cargo.toml b/tests/rust-test/Cargo.toml
new file mode 100644
index 0000000..832ac37
--- /dev/null
+++ b/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/tests/rust-test/src/main.rs b/tests/rust-test/src/main.rs
new file mode 100644
index 0000000..019c3d4
--- /dev/null
+++ b/tests/rust-test/src/main.rs
@@ -0,0 +1,23 @@
+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");
+
+#[test]
+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");
+}