z_value_5_filetest.gno
0.59 Kb ยท 32 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, 1).AsString()
16 expect.Value(t, 1).AsBoolean()
17 expect.Value(t, 1).AsFloat()
18 expect.Value(t, 1).AsUint()
19 expect.Value(t, "").AsInt()
20
21 println(output.String())
22}
23
24// Output:
25// Failed: incompatible type: expected a string value
26// Got: int
27// Failed: incompatible type: expected a boolean value
28// Got: int
29// incompatible type: expected a float value
30// Got: int
31// Failed: incompatible type: expected an int value
32// Got: string