Deprecate old void! @benchmark and @test functions.

This commit is contained in:
Christoffer Lerno
2025-01-09 20:33:53 +01:00
parent c22b7d45c1
commit b941f93416
73 changed files with 988 additions and 860 deletions

View File

@@ -4,7 +4,7 @@ import std::collections::priorityqueue;
def Queue = PriorityQueue(<int>);
fn void! priorityqueue()
fn void priorityqueue()
{
Queue q;
assert(q.is_empty());
@@ -14,25 +14,25 @@ fn void! priorityqueue()
assert(q.len() == 2);
int x;
x = q.pop()!;
x = q.pop()!!;
assert(x == 1, "got %d; want %d", x, 1);
x = q.pop()!;
x = q.pop()!!;
assert(x == 2, "got %d; want %d", x, 2);
q.push(3);
q.push(2);
q.push(1);
x = q.pop()!;
x = q.pop()!!;
assert(x == 1, "got %d; want %d", x, 1);
x = q.pop()!;
x = q.pop()!!;
assert(x == 2, "got %d; want %d", x, 2);
x = q.pop()!;
x = q.pop()!!;
assert(x == 3, "got %d; want %d", x, 3);
}
def QueueMax = PriorityQueueMax(<int>);
fn void! priorityqueue_max()
fn void priorityqueue_max()
{
QueueMax q;
assert(q.is_empty());
@@ -42,18 +42,18 @@ fn void! priorityqueue_max()
assert(q.len() == 2);
int x;
x = q.pop()!;
x = q.pop()!!;
assert(x == 2, "got %d; want %d", x, 2);
x = q.pop()!;
x = q.pop()!!;
assert(x == 1, "got %d; want %d", x, 1);
q.push(3);
q.push(2);
q.push(1);
x = q.pop()!;
x = q.pop()!!;
assert(x == 3, "got %d; want %d", x, 3);
x = q.pop()!;
x = q.pop()!!;
assert(x == 2, "got %d; want %d", x, 2);
x = q.pop()!;
x = q.pop()!!;
assert(x == 1, "got %d; want %d", x, 1);
}