Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

z2_refuse_filetest.gno

1.02 Kb · 29 lines
 1// PKGPATH: gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/z2
 2
 3// Bad names and profiles are refused.
 4package z2
 5
 6import "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots"
 7
 8func main(cur realm) {
 9	println(mybots.Check("Fox", "c1t3i1f6j8r6a7b2s5d4k0"))
10	println(mybots.Check("", "c1t3i1f6j8r6a7b2s5d4k0"))
11	println(mybots.Check(" Fox", "c1t3i1f6j8r6a7b2s5d4k0"))
12	println(mybots.Check("A/B", "c1t3i1f6j8r6a7b2s5d4k0"))
13	println(mybots.Check("Seventeen letters", "c1t3i1f6j8r6a7b2s5d4k0"))
14	println(mybots.Check("Fox", "c1t2i1f6j8r6a7b2s5d4k0"))
15	println(mybots.Check("Fox", "c1t3i1f6j8r6a7b2s5d4k"))
16	println(mybots.Check("Fox", "t3c1i1f6j8r6a7b2s5d4k0"))
17	println(mybots.Count())
18}
19
20// Output:
21// ok
22// name is 1 to 16 characters, no space at either end
23// name is 1 to 16 characters, no space at either end
24// name uses letters, digits, spaces, - and ' only
25// name is 1 to 16 characters, no space at either end
26// profile: t is 3 to 9
27// profile: 11 letter-digit pairs, like c1t3i1f6j8r6a7b2s5d4k0
28// profile: expected c at 1
29// 0