about summary refs log tree commit diff
path: root/src/test/stdtest/net.rs
blob: d2f185a4fdecb64dadd53e546cc383200395b63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std;
import std::net;

#[test]
fn test_format_ip() {
    assert (net::format_addr(net::ipv4(
        127u8, 0u8, 0u8, 1u8)) == ~"127.0.0.1")
}

#[test]
fn test_parse_ip() {
    assert (net::parse_addr(~"127.0.0.1")
            == net::ipv4(127u8, 0u8, 0u8, 1u8));
}