From 38885c9eb5c56ea5eea8b4b2586d247d981286f0 Mon Sep 17 00:00:00 2001 From: "Tom Breton (Tehom)" Date: Wed, 10 Nov 2010 18:03:20 -0500 Subject: [PATCH] Changed examples to now be correct --- elinstall/tests.el | 298 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 180 insertions(+), 118 deletions(-) diff --git a/elinstall/tests.el b/elinstall/tests.el index 4ca15a9..71064f4 100644 --- a/elinstall/tests.el +++ b/elinstall/tests.el @@ -95,128 +95,184 @@ ;;;_ , Given list of actions, segregate it right. ;;;_ . Examples -;;$$OUT OF SYNC These examples are now incorrect. -;;Perhaps best to name them each and then change them. -(defconst xmp:57722cb7-02a9-40eb-b1eb-4a3eb6c9d989 - (emtg:define+ - () +(defconst elinstall:td:examples + (let + ((dir (expand-file-name "2/" elinstall:th:examples))) + (emtg:define+ + () + (transparent-tags () (type name)) - - ;;Empty list - (group ((name 0)) - (item ((type action-list)) - '()) - (item ((type segment-list)) - '())) - ;;List all pointing towrds the same deffile - (group ((name 1)) - (item ((type action-list)) - '( - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-1" "b1"))) + ;;The actions themselves: + (group ((type action)) + (group ((subtype add-file-autoloads)) + (group ((target 1)) + (item ((qname 'a1)) + `(add-file-autoloads "deffile-1" + "a1" + ,dir + ,(expand-file-name "a1.el" dir))) + + (item ((qname 'b)) + `(add-file-autoloads "deffile-1" "b1" ,dir + ,(expand-file-name "b1.el" dir)))) + (group ((target 2)) + (item ((qname 'c)) + `(add-file-autoloads "deffile-2" + "c2" + ,dir + ,(expand-file-name "c2.el" dir))) + + (item ((qname 'd)) + `(add-file-autoloads "deffile-2" "d2" ,dir + ,(expand-file-name "d2.el" dir))))) + (group ((subtype add-to-load-path)) + (item ((target 1)(qname 'alp1)) + `(add-to-load-path "deffile-1" ,dir)) + (item ((target 2)(qname 'alp2)) + `(add-to-load-path "deffile-2" ,dir))) + + (group ((subtype add-to-info-path)) + (item ((target 1)(qname 'aip1)) + `(add-to-info-path "deffile-1" ,dir)) + (item ((target 2)(qname 'aip2)) + `(add-to-info-path "deffile-2" ,dir))) + + (group ((subtype preload-file)) + (item ((target 1)(qname 'plf1)) + `(preload-file "deffile-1" 50)) + (item ((target 2)(qname 'plf2)) + `(preload-file "deffile-2")) + (item ((target 3)(qname 'plf3)) + `(preload-file "deffile-3")))) + + ;;Empty list + (group ((name 0)) + (item ((type action-list)) + '()) + (item ((type segment-list)) + '())) + ;;List all pointing towards the same deffile + (group ((name 1)) + (item ((type action-list)) + `( + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 1)(qname 'b)))) - (item ((type segment-list)) - '(("deffile-1" - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-1" "b2"))))) + (item ((type segment-list)) + `(("deffile-1" + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 1)(qname 'b)))))) - ;;List pointing towards two deffiles - (group ((name 2)) - (item ((type action-list)) - '( - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-2" "c2") - (add-file-autoloads "deffile-1" "b1") - (add-file-autoloads "deffile-2" "d2"))) + ;;List pointing towards two deffiles + (group ((name 2)) + (item ((type action-list)) + `( + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(target 1)(qname 'b)) + ,(emtg (type action)(target 2)(qname 'd)))) - (item ((type segment-list)) - '(("deffile-1" - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-1" "b1")) - ("deffile-2" - (add-file-autoloads "deffile-2" "c2") - (add-file-autoloads "deffile-2" "d2"))))) + (item ((type segment-list)) + `(("deffile-1" + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 1)(qname 'b))) + ("deffile-2" + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(target 2)(qname 'd)))))) - ;;List including all types except preload actions - (group ((name 3)) - (item ((type action-list)) - '( - (add-to-info-path "deffile-1" "dir1") - (add-to-load-path "deffile-1" "dir1") - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-2" "c2") - (add-file-autoloads "deffile-1" "b1") - (add-file-autoloads "deffile-2" "d2") - (add-to-info-path "deffile-2" "dir2") - (add-to-load-path "deffile-2" "dir2") - - )) + ;;List including all types except preload actions + (group ((name 3)) + (item ((type action-list)) + `( + ,(emtg (type action)(subtype add-to-info-path) + (target 1)) + ,(emtg (type action)(subtype add-to-load-path) + (target 2)) + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(target 1)(qname 'b)) + ,(emtg (type action)(target 2)(qname 'd)) + ,(emtg (type action)(subtype add-to-info-path) + (target 2)) + ,(emtg (type action)(subtype add-to-load-path) + (target 1)))) + - (item ((type segment-list)) - '( - ("deffile-1" - (add-to-info-path "deffile-1" "dir1") - (add-to-load-path "deffile-1" "dir1") - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-1" "b1")) - ("deffile-2" - (add-file-autoloads "deffile-2" "c2") - (add-file-autoloads "deffile-2" "d2") - (add-to-info-path "deffile-2" "dir2") - (add-to-load-path "deffile-2" "dir2"))))) + (item ((type segment-list)) + `( + ("deffile-1" + ,(emtg (type action)(subtype add-to-info-path) + (target 1)) + ,(emtg (type action)(subtype add-to-load-path) + (target 1)) + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 1)(qname 'b))) + ("deffile-2" + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(target 2)(qname 'd)) + ,(emtg (type action)(subtype add-to-info-path) + (target 2)) + ,(emtg (type action)(subtype add-to-load-path) + (target 2)))))) - ;;List including some preload actions - (group ((name 4)) - (item ((type action-list)) - '( - (preload-file "deffile-1" 50) - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-2" "c2") - (preload-file "deffile-2") - (add-file-autoloads "deffile-1" "b1") - (add-file-autoloads "deffile-2" "d2") - (preload-file "deffile-3"))) + ;;List including some preload actions + (group ((name 4)) + (item ((type action-list)) + `( + ,(emtg (type action)(subtype preload-file) + (target 1)) + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(subtype preload-file) + (target 2)) + ,(emtg (type action)(target 1)(qname 'b)) + ,(emtg (type action)(target 2)(qname 'd)) + ,(emtg (type action)(subtype preload-file) + (target 3)))) - (item ((type segment-list)) - '( - (nil - (preload-file "deffile-1" 50) - (preload-file "deffile-2") - (preload-file "deffile-3")) + (item ((type segment-list)) + `( + (nil + ,(emtg (type action)(subtype preload-file) + (target 1)) + ,(emtg (type action)(subtype preload-file) + (target 2)) + ,(emtg (type action)(subtype preload-file) + (target 3))) - ("deffile-1" - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-1" "b1")) + ("deffile-1" + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 1)(qname 'b))) - ("deffile-2" - (add-file-autoloads "deffile-2" "c2") - (add-file-autoloads "deffile-2" "d2"))))) + ("deffile-2" + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(target 2)(qname 'd)))))) - ;;List includes some null actions - (group ((name 5)) - (item ((type action-list)) - '( - nil - (add-file-autoloads "deffile-1" "a1") - nil - (add-file-autoloads "deffile-2" "c2") - nil - (add-file-autoloads "deffile-1" "b1") - (add-file-autoloads "deffile-2" "d2"))) + ;;List includes some null actions + (group ((name 5)) + (item ((type action-list)) + `( + nil + ,(emtg (type action)(target 1)(qname 'a1)) + nil + ,(emtg (type action)(target 2)(qname 'c)) + nil + ,(emtg (type action)(target 1)(qname 'b)) + ,(emtg (type action)(target 2)(qname 'd)))) - (item ((type segment-list)) - '(("deffile-1" - (add-file-autoloads "deffile-1" "a1") - (add-file-autoloads "deffile-1" "b1")) - ("deffile-2" - (add-file-autoloads "deffile-2" "c2") - (add-file-autoloads "deffile-2" "d2"))))))) + (item ((type segment-list)) + `(("deffile-1" + ,(emtg (type action)(target 1)(qname 'a1)) + ,(emtg (type action)(target 1)(qname 'b))) + ("deffile-2" + ,(emtg (type action)(target 2)(qname 'c)) + ,(emtg (type action)(target 2)(qname 'd))))))))) ;;;_ . elinstall-remove-autogen-action (emt:deftest-3 elinstall-remove-autogen-action (nil - (emtg:with xmp:57722cb7-02a9-40eb-b1eb-4a3eb6c9d989 () + (emtg:with elinstall:td:examples () (emt:doc "Param: List of actions including an add-file-autoloads for a1.") (emt:doc "Param: filename a1.") @@ -226,7 +282,7 @@ (elinstall-remove-autogen-action "a1" '( - (add-file-autoloads "deffile-1" "a1") + (emtg (type action)(target 1)(name 'a)) (add-file-autoloads "deffile-1" "b1"))) '((add-file-autoloads "deffile-1" "b1"))) @@ -237,7 +293,7 @@ (emt:deftest-3 elinstall-segregate-actions (nil - (emtg:with xmp:57722cb7-02a9-40eb-b1eb-4a3eb6c9d989 () + (emtg:with elinstall:td:examples () (emtg:map name name (let* ((segment-list @@ -260,15 +316,24 @@ ;;Similar requirements for `elinstall-do-segment' (emt:deftest-3 elinstall-update-deffile ;;Test that when called multiple times, it updates right: - ;;Doesn't make two add-to-load-path sections ;;Removes gone files. + ;;Autoloads with slash-path if asked to (That requires another setup) + ;;That will use function 31a1-1 in 31a1.el + ;;Check it by autoloading it. + + ;;load-path is just to "3/" + ;;(For add-to-load-path) + ;;Doesn't make the same add-to-load-path section twice + ;; (nil + (emtg:with elinstall:td:examples (let* ((elinsert:th:found '()) - ;;Because the load will sometimes set it. - (load-path '()) (dir - (expand-file-name "2/" elinstall:th:examples))) + (expand-file-name "2/" elinstall:th:examples)) + ;;Because the load will sometimes set it. + (load-path (list dir))) + (emtb:with-file-f (:absent :visited-name 'tmp) x (emt:doc "Case: Only one autoload") @@ -277,16 +342,13 @@ (emt:doc "Operation: update the def file") (elinstall-update-deffile x `( - (add-file-autoloads "deffile-1" "a1" ,dir - ,(expand-file-name "a1.el" dir))) + ,(emtg (type action)(target 1)(qname 'a1))) (list dir)) - (emt:doc "Operation: load the def file") - (let ((load-path (list dir))) - (load-file x)) - (emt:doc "Operation: update the def file") + (load-file x) + (emt:doc "Response: It has done what was expected") (assert - (equal elinsert:th:found '(a1))))))) + (equal elinsert:th:found '(a1)))))))) ;;;_ , elinstall-remove-autogen-action ;;Test that it removes on the same sort of filename that ;;elinstall-generate-file-autoloads hands to it. -- 2.11.4.GIT