z_string_2_filetest.gno
0.41 Kb ยท 26 lines
1package main
2
3import (
4 "strings"
5
6 "gno.land/p/jeronimoalbi/expect"
7)
8
9var (
10 output strings.Builder
11 t = expect.MockTestingT(&output)
12)
13
14func main() {
15 expect.Value(t, "foo").AsString().ToHaveLength(2)
16 expect.Value(t, "foo").AsString().Not().ToHaveLength(3)
17
18 println(output.String())
19}
20
21// Output:
22// Expected string length to match
23// Got: 3
24// Want: 2
25// Expected string lengths to be different
26// Got: 3