mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
Move const ip in ui test to unit test
This commit is contained in:
parent
0d9651648d
commit
d4ee2f6dc5
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user