z2_refuse_filetest.gno
1.03 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/v3"
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