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

@@ -23,14 +23,14 @@ fn void main()
IntFooMap map;
map.new_init();
io::printfn("Map size: %d", map.count);
map.set(1, Foo { 1, null });
map.set(1, { 1, null });
io::printfn("Map size: %d", map.count);
map.set(1, Foo { 2, null });
map.set(1, { 2, null });
io::printfn("Map size: %d", map.count);
(void)io::printfn("Val: %d", map.get(1).x);
io::printfn("Has 1: %s", map.has_key(1));
io::printfn("Has 2: %s", map.has_key(2));
map.set(7, Foo { 4, null });
map.set(7, { 4, null });
io::printfn("Values: %s", map.value_new_list());
IntDoubleMap map2;
map2.new_init();

View File

@@ -23,14 +23,14 @@ fn void main()
IntFooMap map;
map.new_init();
io::printfn("Map size: %d", map.count);
map.set(1, Foo { 1, null });
map.set(1, { 1, null });
io::printfn("Map size: %d", map.count);
map.set(1, Foo { 2, null });
map.set(1, { 2, null });
io::printfn("Map size: %d", map.count);
(void)io::printfn("Val: %d", map.get(1).x);
io::printfn("Has 1: %s", map.has_key(1));
io::printfn("Has 2: %s", map.has_key(2));
map.set(7, Foo { 4, null });
map.set(7, { 4, null });
io::printfn("Values: %s", map.value_new_list());
IntDoubleMap map2;
map2.new_init();

View File

@@ -10,9 +10,9 @@ fn void main()
{
FooPriorityQueue agh;
agh.push(Foo { 3 });
agh.push(Foo { 101 });
agh.push(Foo { 10 });
agh.push((Foo) { 3 });
agh.push((Foo) { 101 });
agh.push({ 10 });
while (try f = agh.pop()) io::printf("%s\n", f.x);
}