aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lib.rs b/tests/lib.rs
new file mode 100644
index 0000000..15477f7
--- /dev/null
+++ b/tests/lib.rs
@@ -0,0 +1,12 @@
+#![no_std]
+
+use yaxpeax_arch::AddressBase;
+
+#[test]
+fn test_u16() {
+ for l in 0..100 {
+ for r in 0..=core::u16::MAX {
+ assert_eq!(r.wrapping_offset(l.diff(&r).expect("u16 addresses always have valid diffs")), l);
+ }
+ }
+}