Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

render_example_test.gno

0.86 Kb · 23 lines
 1package ringbufferdemo
 2
 3// ExampleRender pins the realm's Render output as a testable example.
 4func ExampleRender() {
 5	print(Render(""))
 6	// Output:
 7	// # Ring Buffer
 8	//
 9	// A fixed-capacity FIFO that overwrites its oldest entry, demoing the [`p/moul/x/daily/ringbuffer`](/p/moul/x/daily/ringbuffer/v0) library.
10	//
11	// Capacity **4**, pushing 6 entries:
12	//
13	// | push | evicted | contents (oldest → newest) |
14	// |---|---|---|
15	// | `alpha` | — | `alpha` |
16	// | `bravo` | — | `alpha bravo` |
17	// | `charlie` | — | `alpha bravo charlie` |
18	// | `delta` | — | `alpha bravo charlie delta` |
19	// | `echo` | `alpha` | `bravo charlie delta echo` |
20	// | `foxtrot` | `bravo` | `charlie delta echo foxtrot` |
21	//
22	// > The buffer never grows: once full, each push costs the oldest entry. On chain that bound is the point — an unbounded queue is an unbounded storage bill.
23}