.. _tests: ======= Tests ======= Tests are cool now. To run them just use: .. code-block:: bash make deps make testgui Tests also run automatically on `Travis-CI `_ using the GUI version of Emacs. So you can tests any frames as on your desktop. Tests themselves are in ``tests/workgroups2-tests.el`` Serialization tests =================== If you see an error like this: .. code-block:: cl wg-add-buffer-to-buf-list(nil) wg-pickel-marker-serializer(#) #[(obj id) "..." [id obj result wg-pickel-object-serializer] 3](# 18) maphash(#[(obj id) "..." [id obj result wg-pickel-object-serializer] 3] #s(hash-table size 65 test eq rehash-size 1.5 rehash-threshold 0.8 data (((# # #) (# # #) (nil # #)) 0 (# # #) 1 # 2 (# #) 3 # 4 (#) 5 # 6 nil 7 ((# # #) (nil # #)) 8 (# # #) 9 # 10 (# #) 11 # 12 (#) 13 # 14 ((nil # #)) 15 (nil # #) 16 (# #) 17 # 18 (#) 19 # 20 ...))) wg-pickel-serialize-objects(#s(hash-table size 65 test eq rehash-size 1.5 rehash-threshold 0.8 data (((# # #) (# # #) (nil # #)) 0 (# # #) 1 # 2 (# #) 3 # 4 (#) 5 # 6 nil 7 ((# # #) (nil # #)) 8 (# # #) 9 # 10 (# #) 11 # 12 (#) 13 # 14 ((nil # #)) 15 (nil # #) 16 (# #) 17 # 18 (#) 19 # 20 ...))) wg-pickel(((# # #) (# # #) (nil # #))) ... then we have a problem in ``wg-pickel`` function. More precisely object ``#`` cannot be serialized. And that was a bug. To create a test in ``workgroups2-tests.el`` for such situation find this: .. code-block:: cl (defmacro test-pickel (value) "Test `wg-pickel' `wg-unpickel' on VALUE." `(eq (wg-unpickel (wg-pickel ,value)) ,value)) (ert-deftest 110-wg-pickel () (test-pickel 123) (test-pickel "str") (test-pickel 'symbol) (test-pickel (current-buffer)) ; # (test-pickel (point-marker)) ; # (test-pickel (make-marker)) ; # (test-pickel (list 'describe-variable 'help-xref-stack-item (get-buffer "*Help*"))) ) And pass an object that cannot be serialized and should be checked. Then you need to fix something in ``wg-pickel``, see :ref:`serialize`.