mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Deprecate old void! @benchmark and @test functions.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user