mirror of
https://github.com/MontFerret/ferret.git
synced 2025-12-13 22:55:40 +02:00
Feature/#263 waitfor event (#590)
* Added new WAITFOR syntax * Added support of event options * Added support of options * Added support of using WAITFOR EVENT in variable assignment
This commit is contained in:
@@ -272,26 +272,56 @@ func TestMember(t *testing.T) {
|
||||
Convey("Deep computed path", func() {
|
||||
c := compiler.New()
|
||||
|
||||
p, err := c.Compile(`
|
||||
LET obj = {
|
||||
first: {
|
||||
second: {
|
||||
third: {
|
||||
fourth: {
|
||||
fifth: {
|
||||
bottom: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p := c.MustCompile(`
|
||||
LET o1 = {
|
||||
first: {
|
||||
second: {
|
||||
["third"]: {
|
||||
fourth: {
|
||||
fifth: {
|
||||
bottom: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RETURN obj["first"]["second"]["third"]["fourth"]["fifth"].bottom
|
||||
LET o2 = { prop: "third" }
|
||||
|
||||
RETURN o1["first"]["second"][o2.prop]["fourth"]["fifth"].bottom
|
||||
`)
|
||||
|
||||
out, err := p.Run(context.Background())
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
So(string(out), ShouldEqual, `true`)
|
||||
})
|
||||
|
||||
Convey("Deep computed path 2", func() {
|
||||
c := compiler.New()
|
||||
|
||||
p := c.MustCompile(`
|
||||
LET o1 = {
|
||||
first: {
|
||||
second: {
|
||||
third: {
|
||||
fourth: {
|
||||
fifth: {
|
||||
bottom: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LET o2 = { prop: "third" }
|
||||
|
||||
RETURN o1.first["second"][o2.prop].fourth["fifth"]["bottom"]
|
||||
`)
|
||||
|
||||
out, err := p.Run(context.Background())
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Reference in New Issue
Block a user