mirror of
https://github.com/MontFerret/ferret.git
synced 2025-03-03 15:02:32 +02:00
Renamted non-safe methods
This commit is contained in:
parent
533f868b85
commit
4d4c6ceadd
@ -91,7 +91,7 @@ func (c *FqlCompiler) Compile(query string) (program *runtime.Program, err error
|
||||
return program, err
|
||||
}
|
||||
|
||||
func (c *FqlCompiler) CompileP(query string) *runtime.Program {
|
||||
func (c *FqlCompiler) MustCompile(query string) *runtime.Program {
|
||||
program, err := c.Compile(query)
|
||||
|
||||
if err != nil {
|
||||
|
@ -1606,7 +1606,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
Convey("RETURN foo ? TRUE : (FOR i IN 1..5 RETURN i*2)", t, func() {
|
||||
c := compiler.New()
|
||||
|
||||
out1, err := c.CompileP(`
|
||||
out1, err := c.MustCompile(`
|
||||
LET foo = FALSE
|
||||
RETURN foo ? TRUE : (FOR i IN 1..5 RETURN i*2)
|
||||
`).Run(context.Background())
|
||||
@ -1614,7 +1614,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(string(out1), ShouldEqual, `[2,4,6,8,10]`)
|
||||
|
||||
out2, err := c.CompileP(`
|
||||
out2, err := c.MustCompile(`
|
||||
LET foo = TRUE
|
||||
RETURN foo ? TRUE : (FOR i IN 1..5 RETURN i*2)
|
||||
`).Run(context.Background())
|
||||
@ -1626,7 +1626,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
Convey("RETURN foo ? (FOR i IN 1..5 RETURN i) : (FOR i IN 1..5 RETURN i*2)", t, func() {
|
||||
c := compiler.New()
|
||||
|
||||
out1, err := c.CompileP(`
|
||||
out1, err := c.MustCompile(`
|
||||
LET foo = FALSE
|
||||
RETURN foo ? (FOR i IN 1..5 RETURN i) : (FOR i IN 1..5 RETURN i*2)
|
||||
`).Run(context.Background())
|
||||
@ -1634,7 +1634,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(string(out1), ShouldEqual, `[2,4,6,8,10]`)
|
||||
|
||||
out2, err := c.CompileP(`
|
||||
out2, err := c.MustCompile(`
|
||||
LET foo = TRUE
|
||||
RETURN foo ? (FOR i IN 1..5 RETURN i) : (FOR i IN 1..5 RETURN i*2)
|
||||
`).Run(context.Background())
|
||||
@ -1646,7 +1646,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
Convey("LET res = foo ? TRUE : (FOR i IN 1..5 RETURN i*2)", t, func() {
|
||||
c := compiler.New()
|
||||
|
||||
out1, err := c.CompileP(`
|
||||
out1, err := c.MustCompile(`
|
||||
LET foo = FALSE
|
||||
LET res = foo ? TRUE : (FOR i IN 1..5 RETURN i*2)
|
||||
RETURN res
|
||||
@ -1655,7 +1655,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(string(out1), ShouldEqual, `[2,4,6,8,10]`)
|
||||
|
||||
out2, err := c.CompileP(`
|
||||
out2, err := c.MustCompile(`
|
||||
LET foo = TRUE
|
||||
LET res = foo ? TRUE : (FOR i IN 1..5 RETURN i*2)
|
||||
RETURN res
|
||||
@ -1668,7 +1668,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
Convey("LET res = foo ? (FOR i IN 1..5 RETURN i) : (FOR i IN 1..5 RETURN i*2)", t, func() {
|
||||
c := compiler.New()
|
||||
|
||||
out1, err := c.CompileP(`
|
||||
out1, err := c.MustCompile(`
|
||||
LET foo = FALSE
|
||||
LET res = foo ? (FOR i IN 1..5 RETURN i) : (FOR i IN 1..5 RETURN i*2)
|
||||
RETURN res
|
||||
@ -1677,7 +1677,7 @@ func TestForTernaryExpression(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(string(out1), ShouldEqual, `[2,4,6,8,10]`)
|
||||
|
||||
out2, err := c.CompileP(`
|
||||
out2, err := c.MustCompile(`
|
||||
LET foo = TRUE
|
||||
LET res = foo ? (FOR i IN 1..5 RETURN i) : (FOR i IN 1..5 RETURN i*2)
|
||||
RETURN res
|
||||
|
@ -41,7 +41,7 @@ func (p *Program) Run(ctx context.Context, setters ...Option) ([]byte, error) {
|
||||
return out.MarshalJSON()
|
||||
}
|
||||
|
||||
func (p *Program) RunP(ctx context.Context, setters ...Option) []byte {
|
||||
func (p *Program) MustRun(ctx context.Context, setters ...Option) []byte {
|
||||
out, err := p.Run(ctx, setters...)
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user