Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add tests for implementing the Eq trait for Address #672

Merged
merged 12 commits into from
Jan 28, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::chain::assert;

fn main() -> bool {
let bits = 0x8900c5bec4ca97d4febf9ceb4754a60d782abbf3cd815836c1872116f203f861;
let bits1 = 0x0000000000000000000000000000000000000000000000000000000000000000;
let bits2 = 0x0000000000000000000000000000000000000000000000000000000000000000;

// test from()
let addr = ~Address::from(bits);
Expand All @@ -14,5 +16,10 @@ fn main() -> bool {
let new_bits = addr.into();
assert(new_bits == bits);

// test Ord
let addr1 = ~Address::from(bits1);
let addr2 = ~Address::from(bits2);
assert(addr1 == addr2); // this fails atm.

true
}