aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-05-03 12:29:24 -0700
committeriximeow <me@iximeow.net>2020-05-03 12:31:49 -0700
commitf7449a21140c109567fa6c756dab2b1b0711a414 (patch)
treebebb35a38490d6bcfc9f73c8880b57146cf7a4a7 /tests
parent12db880a312d8a4b755bd4139c502405c8011f23 (diff)
add AddressDiff, CHANGELOG, and bump to 0.0.40.0.4
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);
+ }
+ }
+}