Skip to content

Throw exception when incomplete sessions definitions are given in def-rules-test #322

Open
@WilliamParker

Description

@WilliamParker

Def-rules-test currently silently ignores session definitions that don't come in tuples of 3. So for example:

(def-rules-test example-test
      {:rules [my-rule ...]
       :sessions [empty-session [my-rule]]}

This will compile but no empty-session will be created. The reason for this is that the implementation uses partition with n=3 and items not fitting into multiples of three are simply discarded.

clara.test-rules> (partition 3 [:a :b])
()
clara.test-rules> (partition 3 [:a :b :c :d])
((:a :b :c))

It would be better to throw an exception and fail to compile if the number of items in the :sessions vector is not a multiple of 3. For reference, the expected input form is

{:sessions [session-name production-names-vec session-options]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions