Updated grammar. Removal of elif. Removal of ':' ';' in some ct statements. Empty faults is now an error. Remove "define" for types. Remove "private". Better errors on incorrect bitstruct syntax. Introduction of wildcard type rather than optional wildcard. Removal of scaled vector type. mkdir and rmdir. Disallow define @Foo() = { @inline }. Add handling for @optreturn and change it to @return!. Restrict interface style functions. Updated x64 ABI. stdlib updates to string. Removed deprecated functions. Update how variadics are implemented. Extended error messages. x86 ABI fixes. Shift check fixes. '!' and '?' are flipped. No trailing ',' allowed in functions. Fix to string parsing. Allow l suffix. Simplifying flatpath. any replaces variant, anyfault replaces anyerr. Allow getting the underlying type of anyfault. De-duplicate string constants. Fix of readme. Extended list. Fix of "(MyEnum)x + 1". Clock and DateTime types. Fixes to array concat.

This commit is contained in:
Christoffer Lerno
2023-03-23 14:49:51 +01:00
committed by Christoffer Lerno
parent d14e778232
commit 809321e20c
270 changed files with 8777 additions and 7237 deletions

View File

@@ -11,34 +11,34 @@ fn void test_ipv4()
fn void! test_ipv4_to_string()
{
InetAddress a = net::ipv4_from_str("127.0.0.1")?;
assert(a.to_string()? == "127.0.0.1");
InetAddress a = net::ipv4_from_str("127.0.0.1")!;
assert(a.to_string()! == "127.0.0.1");
}
fn void! test_ipv6_to_string()
{
InetAddress a = net::ipv6_from_str("2001:db8::2:1")?;
a.to_string()?;
assert(a.to_string()? == "2001:0db8:0000:0000:0000:0000:0002:0001");
assert(net::ipv6_from_str("2001:db8::1").to_string()? == "2001:0db8:0000:0000:0000:0000:0000:0001");
assert(net::ipv6_from_str("::1").to_string()? == "0000:0000:0000:0000:0000:0000:0000:0001");
assert(net::ipv6_from_str("2001::1").to_string()? == "2001:0000:0000:0000:0000:0000:0000:0001");
assert(net::ipv6_from_str("2001:db8:1234::").to_string()? == "2001:0db8:1234:0000:0000:0000:0000:0000");
assert(net::ipv6_from_str("2001::").to_string()? == "2001:0000:0000:0000:0000:0000:0000:0000");
assert(net::ipv6_from_str("::").to_string()? == "0000:0000:0000:0000:0000:0000:0000:0000");
InetAddress a = net::ipv6_from_str("2001:db8::2:1")!;
a.to_string()!;
assert(a.to_string()! == "2001:0db8:0000:0000:0000:0000:0002:0001");
assert(net::ipv6_from_str("2001:db8::1").to_string()! == "2001:0db8:0000:0000:0000:0000:0000:0001");
assert(net::ipv6_from_str("::1").to_string()! == "0000:0000:0000:0000:0000:0000:0000:0001");
assert(net::ipv6_from_str("2001::1").to_string()! == "2001:0000:0000:0000:0000:0000:0000:0001");
assert(net::ipv6_from_str("2001:db8:1234::").to_string()! == "2001:0db8:1234:0000:0000:0000:0000:0000");
assert(net::ipv6_from_str("2001::").to_string()! == "2001:0000:0000:0000:0000:0000:0000:0000");
assert(net::ipv6_from_str("::").to_string()! == "0000:0000:0000:0000:0000:0000:0000:0000");
}
fn void! test_ipv4_parse()
{
InetAddress a = net::ipv4_from_str("127.0.0.1")?;
InetAddress a = net::ipv4_from_str("127.0.0.1")!;
assert(a.ipv4.a == 127 && a.ipv4.b == 0 && a.ipv4.c == 0 && a.ipv4.d == 1);
a = net::ipv4_from_str("255.254.253.255")?;
a = net::ipv4_from_str("255.254.253.255")!;
assert(a.ipv4.a == 255 && a.ipv4.b == 254 && a.ipv4.c == 253 && a.ipv4.d == 255);
assert(catch? net::ipv4_from_str(".1.1.1.1"));
assert(catch? net::ipv4_from_str("1..1.1"));
assert(catch? net::ipv4_from_str("1..1.1.1"));
assert(catch? net::ipv4_from_str("1.1.1.256"));
assert(catch? net::ipv4_from_str("256.1.1.1"));
assert(@catchof(net::ipv4_from_str(".1.1.1.1")));
assert(@catchof(net::ipv4_from_str("1..1.1")));
assert(@catchof(net::ipv4_from_str("1..1.1.1")));
assert(@catchof(net::ipv4_from_str("1.1.1.256")));
assert(@catchof(net::ipv4_from_str("256.1.1.1")));
}
fn void test_ipv6()