1
0
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:
Tim Voronov
2021-07-13 21:34:22 -04:00
committed by GitHub
parent e6c18ebb84
commit 742bdae0ae
36 changed files with 6156 additions and 4786 deletions

View File

@@ -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)