Rollup merge of #79444 - sasurau4:test/move-const-ip, r=matklad

Move const ip in ui test to unit test

Helps with #76268

r? ``@matklad``
This commit is contained in:
Mara Bos 2020-12-01 10:50:15 +00:00 committed by GitHub
commit 2404409c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 13 deletions

View File

@ -936,4 +936,10 @@ fn ip_const() {
const IS_MULTICAST: bool = IP_ADDRESS.is_multicast();
assert!(!IS_MULTICAST);
const IS_IP_V4: bool = IP_ADDRESS.is_ipv4();
assert!(IS_IP_V4);
const IS_IP_V6: bool = IP_ADDRESS.is_ipv6();
assert!(!IS_IP_V6);
}

View File

@ -1,13 +0,0 @@
// run-pass
use std::net::{IpAddr, Ipv4Addr};
fn main() {
const IP_ADDRESS : IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST);
const IS_IP_V4 : bool = IP_ADDRESS.is_ipv4();
assert!(IS_IP_V4);
const IS_IP_V6 : bool = IP_ADDRESS.is_ipv6();
assert!(!IS_IP_V6);
}