Skip to content

Commit 72c0aec

Browse files
committed
Refactor tests
1 parent baa7571 commit 72c0aec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,21 @@ func ExampleRun() {
141141
}
142142

143143
func ExampleDefine() {
144-
type Segment struct {
145-
Origin string
144+
type Group struct {
145+
Name string
146146
}
147-
type Count struct {
148-
Adults int
147+
type User struct {
148+
Age int
149149
}
150150

151-
_, err := expr.Parse("segments[0].Origin + count.Adults", expr.Define("segments", []Segment{}), expr.Define("count", Count{}))
151+
_, err := expr.Parse("groups[0].Name + user.Age", expr.Define("groups", []Group{}), expr.Define("user", User{}))
152152

153153
if err != nil {
154154
fmt.Printf("err: %v", err)
155155
return
156156
}
157157

158-
// Output: err: invalid operation: segments[0].Origin + count.Adults (mismatched types string and int)
158+
// Output: err: invalid operation: groups[0].Name + user.Age (mismatched types string and int)
159159
}
160160

161161
func ExampleWith() {

0 commit comments

Comments
 (0)