Changeset 292 for branches/new-datamodel/src/unit_tests
- Timestamp:
- 04/29/10 15:07:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/new-datamodel/src/unit_tests/datamodel_test.lisp ¶
r291 r292 91 91 :test-merge-constructs-TopicC-8 92 92 :test-merge-constructs-TopicC-9 93 :test-merge-constructs-TopicC-10)) 93 :test-merge-constructs-TopicC-10 94 :test-merge-constructs-AssociationC)) 94 95 95 96 … … 2939 2940 2940 2941 (test test-merge-constructs-TopicC-1 () 2941 "Tests the generic m ove-referenced-constructs corresponding to TopicC."2942 "Tests the generic merge-constructs corresÃŒponding to TopicC." 2942 2943 (with-fixture with-empty-db (*db-dir*) 2943 2944 (let ((rev-1 100) … … 3052 3053 3053 3054 (test test-merge-constructs-TopicC-2 () 3054 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3055 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3055 3056 (with-fixture with-empty-db (*db-dir*) 3056 3057 (let ((rev-1 100) … … 3166 3167 3167 3168 (test test-merge-constructs-TopicC-3 () 3168 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3169 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3169 3170 (with-fixture with-empty-db (*db-dir*) 3170 3171 (let ((rev-1 100) … … 3266 3267 3267 3268 (test test-merge-constructs-TopicC-4 () 3268 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3269 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3269 3270 (with-fixture with-empty-db (*db-dir*) 3270 3271 (let ((rev-1 100) … … 3324 3325 3325 3326 (test test-merge-constructs-TopicC-5 () 3326 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3327 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3327 3328 (with-fixture with-empty-db (*db-dir*) 3328 3329 (let ((rev-1 100) … … 3382 3383 3383 3384 (test test-merge-constructs-TopicC-6 () 3384 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3385 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3385 3386 (with-fixture with-empty-db (*db-dir*) 3386 3387 (let ((rev-1 100) … … 3453 3454 3454 3455 (test test-merge-constructs-TopicC-7 () 3455 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3456 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3456 3457 (with-fixture with-empty-db (*db-dir*) 3457 3458 (let ((rev-1 100) … … 3522 3523 3523 3524 (test test-merge-constructs-TopicC-8 () 3524 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3525 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3525 3526 (with-fixture with-empty-db (*db-dir*) 3526 3527 (let ((rev-1 100) … … 3588 3589 3589 3590 (test test-merge-constructs-TopicC-9 () 3590 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3591 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3591 3592 (with-fixture with-empty-db (*db-dir*) 3592 3593 (let ((rev-1 100) … … 3642 3643 3643 3644 (test test-merge-constructs-TopicC-10 () 3644 "Tests the generic m ove-referenced-constructs corresponding to TopicC."3645 "Tests the generic merge-constructs corresÃŒponding to TopicC." 3645 3646 (with-fixture with-empty-db (*db-dir*) 3646 3647 (let ((rev-1 100) … … 3717 3718 (is-false (set-exclusive-or (list variant-2) (variants name-4))) 3718 3719 (is (= (length (d::versions top-1)) 2)))))))) 3719 3720 3721 3722 ;;TODO: merge associations caused by a merge of their roles 3723 3724 3720 3721 3722 (test test-merge-constructs-AssociationC () 3723 "Tests merge-constructs corresponding to AssociationC." 3724 (with-fixture with-empty-db (*db-dir*) 3725 (let ((rev-1 100) 3726 (rev-2 200) 3727 (rev-3 300)) 3728 (let ((type-1 (make-construct 'TopicC :start-revision rev-1)) 3729 (r-type-1 (make-construct 'TopicC :start-revision rev-1)) 3730 (r-type-2 (make-construct 'TopicC :start-revision rev-1)) 3731 (player-1 (make-construct 'TopicC :start-revision rev-1)) 3732 (player-2 (make-construct 'TopicC :start-revision rev-1)) 3733 (ii-1 (make-construct 'ItemIdentifierC :uri "ii-1")) 3734 (ii-2 (make-construct 'ItemIdentifierC :uri "ii-2"))) 3735 (let ((role-1 (list :start-revision rev-1 3736 :player player-1 3737 :instance-of r-type-1)) 3738 (role-2-1 (list :start-revision rev-1 3739 :player player-1 3740 :instance-of r-type-2)) 3741 (role-2-2 (list :start-revision rev-2 3742 :player player-1 3743 :item-identifiers (list ii-2) 3744 :instance-of r-type-2)) 3745 (role-3 (list :start-revision rev-2 3746 :player player-2 3747 :instance-of r-type-1 3748 :item-identifiers (list ii-1) 3749 :instance-of r-type-2))) 3750 (let ((assoc-1 (make-construct 'AssociationC 3751 :start-revision rev-1 3752 :instance-of type-1 3753 :roles (list role-1 role-2-1))) 3754 (assoc-2 (make-construct 'AssociationC 3755 :start-revision rev-2 3756 :instance-of type-1 3757 :roles (list role-2-2 role-3)))) 3758 (setf *TM-REVISION* rev-3) 3759 (is (= (length (get-all-associations nil)) 2)) 3760 (make-construct 'AssociationC 3761 :start-revision rev-2 3762 :instance-of type-1 3763 :roles (list role-1 role-2-1)) 3764 (is (= (length (get-all-associations nil)) 2)) 3765 (let ((role-2-1-inst 3766 (find-if #'(lambda(role) 3767 (and (eql (instance-of role) r-type-2) 3768 (eql (player role) player-1))) 3769 (roles assoc-1)))) 3770 (is-true role-2-1-inst) 3771 (is (eql (add-item-identifier role-2-1-inst ii-2) role-2-1-inst)) 3772 (is-true (marked-as-deleted-p assoc-2)) 3773 (is-false (roles assoc-2)) 3774 (is-false (instance-of assoc-2)) 3775 (is-false (themes assoc-2)) 3776 (is (eql (instance-of assoc-2 :revision rev-2) type-1)) 3777 (is (= (length (roles assoc-1)) 3)) 3778 (is-true (find-if #'(lambda(role) 3779 (and (eql (instance-of role) r-type-1) 3780 (eql (player role) player-1))) 3781 (roles assoc-1))) 3782 (is-true (find-if #'(lambda(role) 3783 (and (eql (instance-of role) r-type-1) 3784 (eql (player role) player-2) 3785 (not (set-exclusive-or 3786 (list ii-1) 3787 (item-identifiers role))))) 3788 (roles assoc-1))) 3789 (is-true (find-if #'(lambda(role) 3790 (and (eql (instance-of role) r-type-2) 3791 (eql (player role) player-1) 3792 (not (set-exclusive-or 3793 (list ii-2) 3794 (item-identifiers role))))) 3795 (roles assoc-1)))))))))) 3725 3796 3726 3797 … … 3793 3864 (it.bese.fiveam:run! 'test-merge-constructs-TopicC-9) 3794 3865 (it.bese.fiveam:run! 'test-merge-constructs-TopicC-10) 3795 )3866 (it.bese.fiveam:run! 'test-merge-constructs-AssociationC))
Note: See TracChangeset
for help on using the changeset viewer.