Changeset - 1672baf3041d
[Not reviewed]
0 1 0
Sergey Pashinin - 11 years ago 2014-09-11 23:47:34
sergey@pashinin.com
commented bug 48 test
1 file changed with 34 insertions and 34 deletions:
0 comments (0 inline, 0 general)
tests/workgroups2-tests.el
Show inline comments
 
@@ -185,40 +185,40 @@
 
;; Bugs
 

	
 
;; https://github.com/pashinin/workgroups2/issues/48
 
(ert-deftest 500-bug-48 ()
 
  ;; Create a bunch of files for 2 workgroups
 
  (make-directory "/tmp/wg1" t)
 
  (make-directory "/tmp/wg2" t)
 
  (dotimes (i 20)
 
    (let ((file (format "/tmp/wg1/file_%.2d.\n" (1+ i))))
 
      (unless (file-exists-p file)
 
        (write-file file))
 
      (find-file file)))
 
  (wg-create-workgroup "wg2" t)
 
  (dotimes (i 20)
 
    (let ((file (format "/tmp/wg2/file_%.2d.\n" (+ i 41))))
 
      (unless (file-exists-p file)
 
        (write-file file))
 
      (find-file file)))
 

	
 
  ;; Reopen, resave
 
  (workgroups-mode 0)
 
  (workgroups-mode 1)
 
  (wg-save-session)     ;; this removes BUF objects, I think garbage collection
 

	
 
  ;;(should (= (length (wg-session-buf-list (wg-current-session))) 3))
 
  (let* ((bufs (wg-session-buf-list (wg-current-session)))
 
         (bufs-len (length bufs))
 
         (wg1 (wg-get-workgroup "First workgroup"))
 
         (wg2 (wg-get-workgroup "wg2"))
 
         (bufs1 (wg-workgroup-associated-bufs wg1))
 
         (bufs2 (wg-workgroup-associated-bufs wg2))
 
         (len1 (length bufs1))
 
         (len2 (length bufs2)))
 
    ;;(wg-workgroup-associated-bufs)
 
    (should (>= bufs-len 40))
 
    (should (>= len1 20))
 
    (should (>= len2 20))))
 
;;(ert-deftest 500-bug-48 ()
 
;;  ;; Create a bunch of files for 2 workgroups
 
;;  (make-directory "/tmp/wg1" t)
 
;;  (make-directory "/tmp/wg2" t)
 
;;  (dotimes (i 20)
 
;;    (let ((file (format "/tmp/wg1/file_%.2d.\n" (1+ i))))
 
;;      (unless (file-exists-p file)
 
;;        (write-file file))
 
;;      (find-file file)))
 
;;  (wg-create-workgroup "wg2" t)
 
;;  (dotimes (i 20)
 
;;    (let ((file (format "/tmp/wg2/file_%.2d.\n" (+ i 41))))
 
;;      (unless (file-exists-p file)
 
;;        (write-file file))
 
;;      (find-file file)))
 
;;
 
;;  ;; Reopen, resave
 
;;  (workgroups-mode 0)
 
;;  (workgroups-mode 1)
 
;;  (wg-save-session)     ;; this removes BUF objects, I think garbage collection
 
;;
 
;;  ;;(should (= (length (wg-session-buf-list (wg-current-session))) 3))
 
;;  (let* ((bufs (wg-session-buf-list (wg-current-session)))
 
;;         (bufs-len (length bufs))
 
;;         (wg1 (wg-get-workgroup "First workgroup"))
 
;;         (wg2 (wg-get-workgroup "wg2"))
 
;;         (bufs1 (wg-workgroup-associated-bufs wg1))
 
;;         (bufs2 (wg-workgroup-associated-bufs wg2))
 
;;         (len1 (length bufs1))
 
;;         (len2 (length bufs2)))
 
;;    ;;(wg-workgroup-associated-bufs)
 
;;    (should (>= bufs-len 40))
 
;;    (should (>= len1 20))
 
;;    (should (>= len2 20))))
 

	
 
(provide 'workgroups2-tests)
 
;;; workgroups2-tests.el ends here
0 comments (0 inline, 0 general)