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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

render_example_test.gno

1.02 Kb · 26 lines
 1package semverdemo
 2
 3// ExampleRender pins the realm's Render output as a gno testable example.
 4func ExampleRender() {
 5	print(Render(""))
 6	// Output:
 7	// # semver — Semantic Versioning on-chain
 8	//
 9	// Demo of the [`p/moul/x/daily/semver`](/p/moul/x/daily/semver/v0) library — a port of `golang.org/x/mod/semver`. Parse `vMAJOR.MINOR.PATCH[-prerelease][+build]` and compare with SemVer 2.0.0 precedence.
10	//
11	// ## Examples
12	//
13	// | a | rel | b | note |
14	// |---|:---:|---|---|
15	// | `1.2.3` | < | `1.2.10` | numeric patch, not lexical |
16	// | `1.0.0-alpha` | &lt; | `1.0.0` | pre-release < release |
17	// | `1.0.0-alpha.1` | &lt; | `1.0.0-alpha.beta` | numeric id < alphanumeric id |
18	// | `1.0.0-rc.1` | &lt; | `1.0.0` | release candidate < final |
19	// | `2.0.0` | = | `2.0.0+build.5` | build metadata ignored |
20	//
21	// ## Try it
22	//
23	// - Compare two versions: [`/1.2.3/1.2.10`](/r/moul/x/daily/semverdemo/v0:1.2.3/1.2.10)
24	// - Submitted list: [`/sorted`](/r/moul/x/daily/semverdemo/v0:sorted)
25	// - Submit on-chain: `Submit("v1.4.2")`
26}