Skip to content

Duplicate paths in :or condition not leading to multiple facts being inserted #442

@WilliamParker

Description

@WilliamParker

This test fails:

(def-rules-test test-or-sharing-same-condition-in-same-production-duplicate-path
    {:rules [single-rule [[[:or
                            [:and [:or
                                   [::a]
                                   [::b]]
                             [::d]
                             ]
                            [:and
                             [::a]
                             [::d]]]]

                          (insert! {:fact-type ::c})]]

     :queries [c-query [[] [[?c <- ::c]]]]

     :sessions [empty-session [single-rule c-query] {:fact-type-fn :fact-type}]}

    (let [session (-> empty-session
                      (insert {:fact-type ::a})
                      (insert {:fact-type ::d})
                      fire-rules)]

      (is (= (query session c-query)
             [{:?c {:fact-type ::c}}
              {:?c {:fact-type ::c}}]))))

This test was created for issue 436 but commented out since it fails. If fails both before and after the fixes for issue 433.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions