dakusui/scriptiveunit

Lambda feature is missing

dakusui opened this issue · 0 comments

I want to be able to do following in testOracles.

            {
                "description": "Searching 'iPhone' should not return too many accessories",
                "given": ["equals", ["attr", "terms"], ["quote", "iPhone"]],
                "when": ["issue", ["query"] ],
                "then": [">",
                    ["size", ["filter", ["result"], 
                      ["lambda", ["and", 
                        ["matches", ["terms", [0]], ".*iPhone.*"], 
                        ["matches", ["terms", [0]], ".*シルバー.*"] ] ]
                    ]],
                    3
                ]
            }