diff options
author | iximeow <me@iximeow.net> | 2020-02-11 00:22:16 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-02-11 00:22:16 -0800 |
commit | bd9ae00ba84275c9414298d016da21e8106cda36 (patch) | |
tree | a671e957288f00459664beaf1b9e13088daafc52 /test/regspec.rs | |
parent | f08c8bbf9f180283490fc7a4e116e8fa0ffcc681 (diff) |
add `RegSpec::name` to get `&'static str` labels for registers
Diffstat (limited to 'test/regspec.rs')
-rw-r--r-- | test/regspec.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/regspec.rs b/test/regspec.rs new file mode 100644 index 0000000..914c376 --- /dev/null +++ b/test/regspec.rs @@ -0,0 +1,22 @@ +use yaxpeax_x86::long_mode::RegSpec; +use std::collections::{BTreeMap, HashMap}; + +#[test] +fn test_ord() { + let _: BTreeMap<RegSpec, u64> = BTreeMap::new(); +} + +#[test] +fn test_hash() { + let _: HashMap<RegSpec, u64> = HashMap::new(); +} + +#[test] +fn test_labels() { + assert_eq!(RegSpec::rip().name(), "rip"); + assert_eq!(RegSpec::eip().name(), "eip"); + assert_eq!(RegSpec::rflags().name(), "rflags"); + assert_eq!(RegSpec::rbp().name(), "rbp"); + assert_eq!(RegSpec::gs().name(), "gs"); + assert_eq!(RegSpec::al().name(), "al"); +} |