Skip to content

test(outliner, db): tests for operator changes the suite let through - #13679

Open
yuxi-liu-wired wants to merge 10 commits into
logseq:masterfrom
yuxi-liu-wired:test/mutation-library-tests
Open

yuxi-liu-wired wants to merge 10 commits into
logseq:masterfrom
yuxi-liu-wired:test/mutation-library-tests

Conversation

@yuxi-liu-wired

@yuxi-liu-wired yuxi-liu-wired commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Tests only. No source changes.

These tests come from mutation testing: each change of one operator in the source (= to not=, and to or, first to last, when to when-not and so on) that the existing tests let through. Each new test passes on master and fails on at least one such change. Changes that no test could observe (for example first and last of a collection that always holds one item) got no test.

What the tests cover

deps/outliner/test/logseq/outliner/property_mutation_test.cljs (logseq.outliner.property):

  • setting :logseq.property.class/extends to two unrelated parents keeps both
  • batch-set-property! with a collection replaces a :many property's values
  • default values of :number and :default properties are converted by the property's type
  • renaming a property validates the new name and keeps its values
  • upsert-property! with an unchanged schema leaves the property untouched, and sets the given properties
  • adding a closed value to a :many :number property
  • the message of an invalid property value shows its first error
  • a blank page name is rejected, and a block cannot be its own :node value
  • batch-remove-property! deletes only the values no other block uses (shared numbers, ordinary blocks and closed choices stay)

deps/outliner/test/logseq/outliner/op/construct_mutation_test.cljs (logseq.outliner.op.construct, the ops used by undo/redo and sync):

  • ids given as block maps resolve to uuids; refs created in the same transaction are marked; a missing ref is rewritten to its page title
  • :create-page, :insert-blocks and :delete-blocks take their uuids and ids from the transaction data (entity maps, datom maps and [:db/add ...] / [:db/retractEntity ...] vectors)
  • inserts that replace an empty target block, in their sibling, single-block and multi-block cases
  • inverses: moves restore page order, up/down moves invert, groups of different sizes reverse, explicit inverse deletes take the inserted ids, undo picks the built or the explicit inverse, and an inverse needs every block and a target
  • stale numeric entity ids are rejected

deps/db/test/logseq/db_mutation_test.cljs (logseq.db):

  • the registered transact and invalid-data callbacks are called; :block.temp/* attributes are dropped; a page with a block parent is rejected; a transaction without changes commits nothing; the failure log follows its suppress flags; entities given as bare items are dropped; deleting blocks retracts their children
  • an empty batch in batch-transact-with-temp-conn! builds no tx meta
  • siblings and get-down of nil are nil; journal page lookup by day at its edges
  • page-empty? and orphaned pages; sort-page-random-blocks leaves out property value blocks and keeps the given order of siblings sharing an order
  • the alias source page of an alias of two pages, the graph's RTC uuid, and the bidirectional properties (custom title, no target, recycled classes, db attributes ignored)

Checks

  • On master (f11f5f8): logseq.outliner.property-mutation-test and logseq.outliner.op.construct-mutation-test 29 tests, 87 assertions; logseq.db-mutation-test 21 tests, 47 assertions; 0 failures, 0 errors.
  • Each test claimed to catch a change was run with that change applied and failed (140 changes).
  • clj-kondo (--lint src test), carve, large-vars, ns-docstrings and minimize-public-vars clean in deps/outliner and deps/db.
Which mutants each test catches

Each row: a change of one operator in the source (at the commit the mutation pass ran on) that the existing tests let through and this test fails on.

Test Source In Change Line
register-transact-fn-receives-transact-of-a-repo-test deps/db/src/logseq/db.cljs register-transact-fn! when → when-not (when f (reset! *transact-fn f)))
register-transact-fn-receives-transact-of-a-repo-test deps/db/src/logseq/db.cljs transact! and → or expand-deletes? (and (not (string? repo-or-conn))
register-transact-fn-receives-transact-of-a-repo-test deps/db/src/logseq/db.cljs transact! if → if-not tx-data (if expand-deletes?
register-transact-invalid-callback-fn-is-told-of-invalid-data-test deps/db/src/logseq/db.cljs register-transact-invalid-callback-fn! when → when-not (when f (reset! *transact-invalid-callback f)))
transact-drops-block-temp-attributes-test deps/db/src/logseq/db.cljs remove-temp-block-data seq → empty? (seq (:block/refs data))
transact-drops-block-temp-attributes-test deps/db/src/logseq/db.cljs remove-temp-block-data first → last (contains? #{:db/add :db/retract} (first data))
transact-drops-entities-given-as-bare-items-test deps/db/src/logseq/db.cljs transact! or → and (remove (fn [m] (or ;; db/id
transact-rejects-a-page-with-a-block-parent-test deps/db/src/logseq/db.cljs throw-if-page-has-block-parent! = → not= (= :block/parent (:a d))
transact-without-changes-commits-nothing-test deps/db/src/logseq/db.cljs transact-sync and → or (and tx-report (seq (:tx-data tx-report)))
transact-failed-log-follows-suppress-flags-test deps/db/src/logseq/db.cljs transact-sync or → and (when-not (or (:db-sync/suppress-transact-failed-log? tx-meta)
transact-failed-log-follows-suppress-flags-test deps/db/src/logseq/db.cljs transact-sync and → or (and (:db-sync/suppress-stale-rebase-transact-failed-log? tx-meta)
transact-failed-log-follows-suppress-flags-test deps/db/src/logseq/db.cljs transact-sync = → not= (= :entity-id/missing (:error (ex-data e)))))
transact-delete-blocks-retracts-children-test deps/db/src/logseq/db.cljs transact! if → if-not tx-data (if expand-deletes?
batch-transact-with-temp-conn-empty-batch-builds-no-tx-meta-test deps/db/src/logseq/db.cljs batch-transact-with-temp-conn! and → or (when (and @*complete? (seq tx-data))
siblings-and-down-of-nil-are-nil-test deps/db/src/logseq/db.cljs get-right-sibling nil? → some? (assert (or (de/entity? block) (nil? block)))
siblings-and-down-of-nil-are-nil-test deps/db/src/logseq/db.cljs get-left-sibling nil? → some? (assert (or (de/entity? block) (nil? block)))
siblings-and-down-of-nil-are-nil-test deps/db/src/logseq/db.cljs get-down nil? → some? (assert (or (de/entity? block) (nil? block)))
get-journal-page-by-day-edges-test deps/db/src/logseq/db.cljs get-journal-page-by-day and → or (when (and db journal-day)
get-journal-page-by-day-edges-test deps/db/src/logseq/db.cljs get-journal-page-by-day first → last (when-let [eid (some-> (first (d/datoms db :avet :block/journal-day journal-day)
page-empty-and-orphaned-pages-test deps/db/src/logseq/db.cljs page-empty? if → if-not (let [page-id (if (string? page-id)
page-empty-and-orphaned-pages-test deps/db/src/logseq/db.cljs get-orphaned-pages not → identity (not (journal? page))))
sort-page-random-blocks-leaves-out-property-value-blocks-test deps/db/src/logseq/db.cljs block-order-path or → and (if (or (:logseq.property/created-from-property block)
sort-page-random-blocks-keeps-given-order-of-siblings-sharing-an-order-test deps/db/src/logseq/db.cljs compare-order-paths nil? → some? (and (nil? path-1) (nil? path-2)) 0
get-alias-source-page-of-an-alias-of-2-pages-is-the-older-test deps/db/src/logseq/db.cljs get-alias-source-page first → last (first (:block/_alias (d/entity db alias-id)))))
get-graph-rtc-uuid-test deps/db/src/logseq/db.cljs get-graph-rtc-uuid when → when-not (when db (get-key-value db :logseq.kv/graph-uuid)))
get-bidirectional-properties-custom-title-test deps/db/src/logseq/db.cljs build-bidirectional-property-group if → if-not (if (string? custom)
get-bidirectional-properties-without-target-is-nil-test deps/db/src/logseq/db.cljs get-bidirectional-properties and → or (when (and db target-id
get-bidirectional-properties-ignores-recycled-classes-test deps/db/src/logseq/db.cljs get-bidirectional-properties and → or (when (and (not (built-in? class-ent))
get-bidirectional-properties-ignores-db-attributes-test deps/db/src/logseq/db.cljs bidirectional-property-attr? and → or (and (or (db-property/user-property-namespace? attr-ns)
derive-history-outliner-ops-resolves-block-maps-to-uuids-test deps/outliner/src/logseq/outliner/op/construct.cljc stable-entity-ref or → and (let [eid (or (:db/id x)
derive-history-outliner-ops-save-block-marks-refs-created-in-tx-test deps/outliner/src/logseq/outliner/op/construct.cljc sanitize-block-payload when → when-not created-ref-uuids (when (and (seq created-uuids) (seq refs))
derive-history-outliner-ops-save-block-marks-refs-created-in-tx-test deps/outliner/src/logseq/outliner/op/construct.cljc sanitize-block-payload seq → empty? created-ref-uuids (when (and (seq created-uuids) (seq refs))
derive-history-outliner-ops-save-block-marks-refs-created-in-tx-test deps/outliner/src/logseq/outliner/op/construct.cljc sanitize-block-payload seq → empty? created-ref-uuids (when (and (seq created-uuids) (seq refs))
derive-history-outliner-ops-save-block-marks-refs-created-in-tx-test deps/outliner/src/logseq/outliner/op/construct.cljc sanitize-block-payload seq → empty? (seq created-ref-uuids)
derive-history-outliner-ops-save-block-marks-refs-created-in-tx-test deps/outliner/src/logseq/outliner/op/construct.cljc created-block-uuids-from-tx-data >= → > (>= (count item) 4)
rewrite-block-title-with-retracted-refs-restores-missing-ref-test deps/outliner/src/logseq/outliner/op/construct.cljc get-missing-ref-by-lookup or → and :block/title (or title "")
rewrite-block-title-with-retracted-refs-restores-missing-ref-test deps/outliner/src/logseq/outliner/op/construct.cljc rewrite-block-title-with-retracted-refs seq → empty? (seq retracted-refs)
derive-history-outliner-ops-create-page-finds-created-uuid-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc created-page-uuid-from-tx-data when → when-not (when (and (map? item)
derive-history-outliner-ops-create-page-finds-created-uuid-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc created-page-uuid-from-tx-data and → or (when (and (map? item)
derive-history-outliner-ops-create-page-finds-created-uuid-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc created-page-uuid-from-tx-data = → not= (= title (:block/title item))
derive-history-outliner-ops-create-page-finds-created-uuid-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc created-page-uuid-from-tx-data and → or (when (and (= :block/title (:a datom))
derive-history-outliner-ops-create-page-finds-created-uuid-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc created-page-uuid-from-tx-data and → or (when (and (= title title') (uuid? uuid'))
derive-history-outliner-ops-delete-blocks-takes-ids-retracted-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids = → not= (= :db/retractEntity (first item))
derive-history-outliner-ops-delete-blocks-takes-ids-retracted-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids first → last (= :db/retractEntity (first item))
derive-history-outliner-ops-delete-blocks-takes-ids-retracted-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids >= → > (>= (count item) 2))
derive-history-outliner-ops-delete-blocks-takes-ids-retracted-in-tx-data-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids = → not= (= :block/uuid (:a item)))
derive-history-outliner-ops-delete-blocks-takes-created-uuids-for-missing-lookups-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids seq → empty? unresolved-created-lookups? (and (seq created-uuids)
derive-history-outliner-ops-delete-blocks-takes-created-uuids-for-missing-lookups-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids = → not= (= (count ids') (count created-uuids))
derive-history-outliner-ops-delete-blocks-takes-created-uuids-for-missing-lookups-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids and → or (and (vector? id)
derive-history-outliner-ops-delete-blocks-takes-created-uuids-for-missing-lookups-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids = → not= (= :block/uuid (first id))
derive-history-outliner-ops-delete-blocks-takes-created-uuids-for-missing-lookups-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids first → last (= :block/uuid (first id))
derive-history-outliner-ops-delete-blocks-takes-created-uuids-for-missing-lookups-test deps/outliner/src/logseq/outliner/op/construct.cljc maybe-rewrite-delete-block-ids nil? → some? (nil? (d/entity db id))))
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc inserted-block-uuids-from-tx-data some? → nil? (some? (:a item)) (:e item)
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc inserted-block-uuids-from-tx-data or → and :else (or (:db/id item) [:block/uuid (:block/uuid item)])))
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc inserted-block-uuids-from-tx-data and → or (and (= :block/parent (:a item))
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc inserted-block-uuids-from-tx-data = → not= (and (= :block/parent (:a item))
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc inserted-block-uuids-from-tx-data = → not= (= :block/parent (nth item 2 nil))))))
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-ops if → if-not blocks (if (= :insert-blocks op) (first args') (get-in args' [2 :template-blocks
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-ops = → not= blocks (if (= :insert-blocks op) (first args') (get-in args' [2 :template-blocks
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-ops first → last blocks (if (= :insert-blocks op) (first args') (get-in args' [2 :template-blocks
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-ops not → identity (assoc :available (filterv #(not (contains? inserted-uuids %)) available))))
derive-history-outliner-ops-insert-blocks-takes-uuids-of-inserted-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-explicit-outliner-op-groups first → last (let [canonicalized-op (if (contains? #{:insert-blocks :apply-template} (first o
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? or → and (and (or (:replace-empty-target? opts)
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? and → or (and (:sibling? opts) (> (count source-uuids) 1)))
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? > → >= (and (:sibling? opts) (> (count source-uuids) 1)))
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? first → last (or (= (first source-uuids) (:block/uuid (d/entity db target-ref)))
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? = → not= (= :db/add (first item))]
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? first → last (= :db/add (first item))]
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? and → or (and (= :block/title a) (false? added?)
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc replaces-empty-target? = → not= (and (= :block/title a) (false? added?)
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-blocks-op or → and (if (or replaced-target?
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-blocks-op and → or (and (:replace-empty-target? opts)
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-blocks-op = → not= (= (inc (count created-uuids)) (count source-blocks))))
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-blocks-op inc → dec (= (inc (count created-uuids)) (count source-blocks))))
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-blocks-op if → if-not (if (seq created-rst-uuids)
derive-history-outliner-ops-insert-blocks-replaces-empty-target-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-blocks-op seq → empty? (if (seq created-rst-uuids)
derive-history-outliner-ops-move-blocks-inverse-restores-in-page-order-test deps/outliner/src/logseq/outliner/op/construct.cljc compare-document-order nil? → some? (nil? path-1) -1
derive-history-outliner-ops-move-blocks-inverse-restores-in-page-order-test deps/outliner/src/logseq/outliner/op/construct.cljc compare-document-order nil? → some? (nil? path-2) 1
derive-history-outliner-ops-move-blocks-inverse-restores-in-page-order-test deps/outliner/src/logseq/outliner/op/construct.cljc compare-document-order if → if-not (if (zero? c)
derive-history-outliner-ops-move-blocks-up-down-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc opposite-move-restores? seq → empty? (seq top-level-blocks)
derive-history-outliner-ops-move-blocks-up-down-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc opposite-move-restores? = → not= (= (:db/id left) (:db/id (ldb/get-left-sibling right))))
derive-history-outliner-ops-move-blocks-up-down-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc opposite-move-restores? some? → nil? (some? (if up?
derive-history-outliner-ops-move-blocks-up-down-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc opposite-move-restores? if → if-not (some? (if up?
derive-history-outliner-ops-move-blocks-up-down-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc opposite-move-restores? first → last (ldb/get-left-sibling (first top-level-blocks))
derive-history-outliner-ops-move-blocks-up-down-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc opposite-move-restores? last → first (ldb/get-right-sibling (last top-level-blocks)))))))
derive-history-outliner-ops-inverse-reverses-groups-of-different-sizes-test deps/outliner/src/logseq/outliner/op/construct.cljc canonical-move-op-for-block or → and (assoc (dissoc (or opts {}) :outliner-op)
derive-history-outliner-ops-inverse-reverses-groups-of-different-sizes-test deps/outliner/src/logseq/outliner/op/construct.cljc reverse-inverse-entry-groups first → last (if-let [group-size (first sizes)]
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc has-replace-empty-target-insert-op? and → or (and (contains? #{:insert-blocks :apply-template} op)
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops first → last (filter #(contains? #{:insert-blocks :apply-template} (first %)))
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops first → last (first args)
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops or → and (->> (or blocks [])
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops = → not= (if (and (= :delete-blocks op)
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops seq → empty? (seq @forward-insert-ops*))
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops first → last (let [ids (op->inserted-ids (first @forward-insert-ops*))]
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops if → if-not (if (seq ids)
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops seq → empty? (if (seq ids)
derive-history-outliner-ops-explicit-inverse-deletes-take-inserted-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc derive-history-outliner-ops nil? → some? (nil? explicit-inverse-outliner-ops)
derive-history-outliner-ops-undo-picks-built-or-explicit-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc build-inverse-insert-like and → or (when (and (= :block/uuid (:a d))
derive-history-outliner-ops-undo-picks-built-or-explicit-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc patch-inverse-delete-block-ops = → not= (if (and (= :delete-blocks op)
derive-history-outliner-ops-undo-picks-built-or-explicit-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc derive-history-outliner-ops and → or (and (= :apply-template (:outliner-op tx-meta))
derive-history-outliner-ops-undo-picks-built-or-explicit-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc derive-history-outliner-ops = → not= (and (= :apply-template (:outliner-op tx-meta))
derive-history-outliner-ops-undo-picks-built-or-explicit-inverse-test deps/outliner/src/logseq/outliner/op/construct.cljc derive-history-outliner-ops seq → empty? (seq (:db-sync/inverse-outliner-ops tx-meta)))
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-template-op and → or (when-not (and template-ref target-ref)
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-ops if → if-not blocks (if (= :insert-blocks op) (first args') (get-in args' [2 :template-blocks
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-insert-ops = → not= blocks (if (= :insert-blocks op) (first args') (get-in args' [2 :template-blocks
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-semantic-outliner-op or → and (cond-> (or opts {})
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc stale-numeric-id-in-page-ops? or → and (or (some #(numeric-id-in-block-ref-attrs? db %) blocks)
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc stale-numeric-id-in-page-ops? or → and (or (unresolved-numeric-entity-id? template-id)
derive-history-outliner-ops-rejects-stale-numeric-ids-test deps/outliner/src/logseq/outliner/op/construct.cljc stale-numeric-id-in-op? not= → = (and (not= :transact op)
derive-history-outliner-ops-forward-op-shapes-test deps/outliner/src/logseq/outliner/op/construct.cljc canonicalize-semantic-outliner-op or → and (cond-> (or opts {})
derive-history-outliner-ops-forward-op-shapes-test deps/outliner/src/logseq/outliner/op/construct.cljc normalize-op-entries first → last (and (keyword? (first ops'))
derive-history-outliner-ops-forward-op-shapes-test deps/outliner/src/logseq/outliner/op/construct.cljc canonical-block-id and → or (and (integer? block-id)
derive-history-outliner-ops-forward-op-shapes-test deps/outliner/src/logseq/outliner/op/construct.cljc canonical-property-id and → or (and (integer? property-id)
derive-history-outliner-ops-inverse-needs-every-block-and-a-target-test deps/outliner/src/logseq/outliner/op/construct.cljc delete-root->restore-plan and → or (when (and (seq blocks) (some? target-id))
derive-history-outliner-ops-inverse-needs-every-block-and-a-target-test deps/outliner/src/logseq/outliner/op/construct.cljc build-inverse-delete-blocks and → or (when (and (not incomplete?)
derive-history-outliner-ops-inverse-needs-every-block-and-a-target-test deps/outliner/src/logseq/outliner/op/construct.cljc move-root->restore-op and → or (when (and (some? root-id)
derive-history-outliner-ops-inverse-needs-every-block-and-a-target-test deps/outliner/src/logseq/outliner/op/construct.cljc build-inverse-move-blocks and → or (when (and (not incomplete?)
derive-history-outliner-ops-delete-inverse-defers-refs-to-later-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc split-block-refs if → if-not [(if (seq out) (assoc block' k (set out)) (dissoc block' k))
derive-history-outliner-ops-delete-inverse-defers-refs-to-later-blocks-test deps/outliner/src/logseq/outliner/op/construct.cljc split-block-refs seq → empty? [(if (seq out) (assoc block' k (set out)) (dissoc block' k))
extends-with-two-unrelated-parents-keeps-both deps/outliner/src/logseq/outliner/property.cljs normalize-extends-value if → if-not (if (single-entity-ref? value)
batch-set-property-collection-replaces-many-values deps/outliner/src/logseq/outliner/property.cljs build-property-value-tx-data = → not= multiple-values? (= :db.cardinality/many (:db/cardinality property))
convert-property-input-string-parses-default-value-of-number-property deps/outliner/src/logseq/outliner/property.cljs convert-property-input-string and → or (and (= (:db/ident property) :logseq.property/default-value)
convert-property-input-string-parses-default-value-of-number-property deps/outliner/src/logseq/outliner/property.cljs convert-property-input-string = → not= (and (= (:db/ident property) :logseq.property/default-value)
upsert-property-rename-validates-new-name deps/outliner/src/logseq/outliner/property.cljs validate-property-name-update not= → = (when (and (some? property-name) (not= property-name (:block/title property)))
upsert-property-rename-property-with-values deps/outliner/src/logseq/outliner/property.cljs schema-for-update and → or (let [many->one? (and (db-property/many? property)
upsert-property-rename-property-with-values deps/outliner/src/logseq/outliner/property.cljs update-property not= → = (and (some? property-name) (not= property-name (:block/title property)))
upsert-property-with-unchanged-schema-leaves-property-untouched deps/outliner/src/logseq/outliner/property.cljs update-property and → or (and (seq schema)
upsert-property-with-unchanged-schema-leaves-property-untouched deps/outliner/src/logseq/outliner/property.cljs update-property and → or (and (:db/cardinality schema) (not= (:db/cardinality schema) (keyword (name (:db
upsert-property-with-unchanged-schema-leaves-property-untouched deps/outliner/src/logseq/outliner/property.cljs update-property and → or (and (= :default (:logseq.property/type schema)) (not= :db.type/ref (:db/valueTy
upsert-property-with-unchanged-schema-leaves-property-untouched deps/outliner/src/logseq/outliner/property.cljs update-property = → not= (and (= :default (:logseq.property/type schema)) (not= :db.type/ref (:db/valueTy
upsert-property-with-unchanged-schema-leaves-property-untouched deps/outliner/src/logseq/outliner/property.cljs update-property not= → = (and (= :default (:logseq.property/type schema)) (not= :db.type/ref (:db/valueTy
upsert-property-with-unchanged-schema-leaves-property-untouched deps/outliner/src/logseq/outliner/property.cljs update-property seq → empty? (seq (entity-plus/lookup-kv-then-entity property :property/closed-values))))
upsert-property-sets-given-properties deps/outliner/src/logseq/outliner/property.cljs update-property when → when-not (when (seq properties)
upsert-property-sets-given-properties deps/outliner/src/logseq/outliner/property.cljs update-property seq → empty? (when (seq properties)
upsert-closed-value-on-many-number-property deps/outliner/src/logseq/outliner/property.cljs validate-property-value-aux not → identity (let [value' (if (and many? (not (sequential? value)))
invalid-property-value-message-shows-first-error deps/outliner/src/logseq/outliner/property.cljs validate! if → if-not error-msg (str "Property validation failed: \"" (:block/title property) "\" " (i
set-page-property-to-blank-string-is-rejected deps/outliner/src/logseq/outliner/property.cljs convert-ref-property-value or → and (if (or (string/blank? v) (not (string? v)))
batch-set-property-rejects-own-block-in-collection deps/outliner/src/logseq/outliner/property.cljs throw-error-if-self-value or → and (let [values (if (or (sequential? value) (set? value)) value [value])]
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! nil? → some? (nil? value-referrers*)
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! and → or (and
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! not → identity (not (or (entity-util/page? value) (ldb/closed-value? value)))
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! or → and (not (or (entity-util/page? value) (ldb/closed-value? value)))
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! empty? → seq (empty? (set/difference value-referrers block-id-set)))))
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! when → when-not retract-blocks-tx (when (seq deleting-entities)
batch-remove-property-deletes-only-unshared-created-values deps/outliner/src/logseq/outliner/property.cljs batch-remove-property! seq → empty? retract-blocks-tx (when (seq deleting-entities)

yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Oct 11, 2026
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Oct 13, 2026
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Oct 16, 2026
@yuxi-liu-wired
yuxi-liu-wired force-pushed the test/mutation-library-tests branch 5 times, most recently from 9cee638 to ff758a8 Compare October 22, 2026 11:01
@yuxi-liu-wired
yuxi-liu-wired force-pushed the test/mutation-library-tests branch 5 times, most recently from 25c1cb3 to 33e4df1 Compare October 31, 2026 11:00
@yuxi-liu-wired
yuxi-liu-wired force-pushed the test/mutation-library-tests branch from 33e4df1 to 0e75e52 Compare November 3, 2026 12:00
@yuxi-liu-wired
yuxi-liu-wired force-pushed the test/mutation-library-tests branch 7 times, most recently from 7b3cba7 to 09ef9c5 Compare November 18, 2026 14:37
Catches mutant 174:if->if-not@7111 in normalize-extends-value.
Covers many-value replacement, default-value input parsing, property
rename validation and many-to-one guard, unchanged-schema upserts,
upsert :properties, closed choices on many number properties, the
validation message, blank page values, self values in collections and
which created values batch-remove-property! deletes.
@yuxi-liu-wired
yuxi-liu-wired force-pushed the test/mutation-library-tests branch from 09ef9c5 to b888bd3 Compare November 19, 2026 12:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant