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.61 Kb · 26 lines
 1package calc
 2
 3// ExampleRender pins the realm's Render output as a testable example.
 4func ExampleRender() {
 5	print(Render(""))
 6	// Output:
 7	// # RPN Calculator
 8	//
 9	// ## Result
10	//
11	// _(empty stack)_
12	//
13	// ## Stack (bottom → top)
14	//
15	// _empty_
16	//
17	// ## Usage
18	//
19	// Reverse Polish Notation: operands first, operator last.
20	//
21	// - `Push("5")` then `Push("3")` then `Push("+")` → `8`
22	// - Supported operators: `+`, `-`, `*`, `/` (integer division)
23	// - An operator pops the top two values (a, b) and pushes `a op b`.
24	// - `Clear()` empties the stack.
25	// - Divide-by-zero and underflow abort the transaction.
26}