Skip to content

Commit

Permalink
add tests for pp functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tralph3 committed Aug 28, 2024
1 parent 93caf20 commit c424620
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions conner-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,20 @@
(conner--act-on-project (lambda (root-dir) (should (equal root-dir "/test"))) "/test"))
(let ((conner-project-backend 'project.el))
(conner--act-on-project (lambda (root-dir) (should (equal root-dir "/test"))) '(vc Git "/test")))))

(ert-deftest conner-test-pp-functions-error ()
(with-temp-env
(should-error (conner--pp-list "not a list"))
(should-error (conner--pp-plist "not a plist"))
(should-error (conner--pp-plist '("also" "not" "a plist")))
(should-error (conner--pp-plist-list "not a list"))))

(ert-deftest conner-test-pp-functions-output ()
(with-temp-env
(should (equal (conner--pp-list '(a)) "(a)"))
(should (equal (conner--pp-list '(a b)) "(a\n b)"))
(should (equal (conner--pp-plist '(a b)) "(a b)"))
(should (equal (conner--pp-plist '(a b c d)) "(a b\n c d)"))
(should (equal (conner--pp-plist-list '((a b c d))) "((a b\n c d))"))
(should (equal (conner--pp-plist-list '((a b c d) (e f g h))) "((a b\n c d)\n (e f\n g h))"))
(should (equal (conner--pp-plist-list '((a b c d) (e f g (h i j k)))) "((a b\n c d)\n (e f\n g (h\n i\n j\n k)))"))))

0 comments on commit c424620

Please sign in to comment.