mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
25 lines
277 B
Plaintext
25 lines
277 B
Plaintext
module any_tests @test;
|
|
|
|
fn void any_compare()
|
|
{
|
|
int x;
|
|
any a = &x;
|
|
any b = &x;
|
|
assert(a == b);
|
|
assert(a == a);
|
|
}
|
|
|
|
alias AnyAlias = any;
|
|
|
|
fn void test_aliasing()
|
|
{
|
|
int x;
|
|
AnyAlias z = &x;
|
|
switch (z.type)
|
|
{
|
|
case int:
|
|
assert(true);
|
|
default:
|
|
assert(false);
|
|
}
|
|
} |