mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
std/collections: add RingBuffer.popc()
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
committed by
Christoffer Lerno
parent
b1f52cf8a9
commit
eedb2c3c52
@@ -4,7 +4,7 @@ import std::io;
|
||||
|
||||
def Buffer = RingBuffer(<char, 4>);
|
||||
|
||||
fn void putc_getc()
|
||||
fn void! putc_getc()
|
||||
{
|
||||
Buffer rb;
|
||||
rb.init();
|
||||
@@ -23,4 +23,7 @@ fn void putc_getc()
|
||||
assert(rb.getc(1) == 3);
|
||||
assert(rb.getc(2) == 4);
|
||||
assert(rb.getc(3) == 5);
|
||||
|
||||
char c = rb.popc()!;
|
||||
assert(c == 5);
|
||||
}
|
||||
Reference in New Issue
Block a user