2011-08-15 18:54:02 -05:00
|
|
|
use std;
|
|
|
|
import std::net;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_format_ip() {
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (net::format_addr(net::ipv4(127u8, 0u8, 0u8, 1u8)) == "127.0.0.1")
|
2011-08-15 18:54:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_parse_ip() {
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (net::parse_addr("127.0.0.1") == net::ipv4(127u8, 0u8, 0u8, 1u8));
|
2011-08-15 18:54:02 -05:00
|
|
|
}
|