Update tests to (Foo) { ... } syntax.

This commit is contained in:
Christoffer Lerno
2025-02-18 18:53:30 +01:00
parent 168c11e006
commit cbacd64987
98 changed files with 449 additions and 551 deletions

View File

@@ -24,9 +24,9 @@ fn void concat()
free(array::concat_new(a, a));
free(array::concat_new(a[..], a[..]));
free(array::concat_new(a[:0], a[:0]));
free(array::concat_new(int[2] { 1, 2 }, a[:0]));
free(array::concat_new(a[:0], int[2] { 1, 2 }));
free(array::concat_new((int[2]) { 1, 2 }, a[:0]));
free(array::concat_new(a[:0], (int[2]) { 1, 2 }));
int[] c = array::concat_new(a[1..2], a);
defer free(c);
assert (c == int[]{ 2, 3, 1, 2, 3 });
assert (c == (int[]){ 2, 3, 1, 2, 3 });
}

View File

@@ -62,16 +62,16 @@ fn void test_prefetch()
fn void test_hash()
{
char{}.hash();
ichar{}.hash();
short{}.hash();
ushort{}.hash();
int{}.hash();
uint{}.hash();
long{}.hash();
ulong{}.hash();
int128{}.hash();
uint128{}.hash();
(char){}.hash();
(ichar){}.hash();
(short){}.hash();
(ushort){}.hash();
(int){}.hash();
(uint){}.hash();
(long){}.hash();
(ulong){}.hash();
(int128){}.hash();
(uint128){}.hash();
String x = "abc";
char[] y = "abc";
assert(x.hash() == y.hash());

View File

@@ -10,7 +10,7 @@ fn usz! Foo.to_format(&self, Formatter *f) @dynamic
fn void test_ref() @test
{
Foo* f = &&Foo{ 8 };
Foo* f = &&(Foo){ 8 };
Foo* f0 = null;
int* a = (void*)(uptr)0x40;
int* b = null;