Skip to content

Commit

Permalink
Use equal instead of cl-every
Browse files Browse the repository at this point in the history
  • Loading branch information
dajva committed Sep 8, 2018
1 parent 842452c commit b161fe1
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions test/rg.el-test.el
Expand Up @@ -90,19 +90,19 @@
(cl-letf (((symbol-function #'rg-rerun) #'ignore)
((symbol-function #'rg-read-pattern) (lambda (&rest _) "new-pattern")))
(rg-rerun-change-regexp)
(should (cl-every 'equal
(rg-search-create :pattern "new-pattern"
:files "elisp"
:dir "/tmp/test"
:literal nil)
rg-cur-search))
(should (equal
(rg-search-create :pattern "new-pattern"
:files "elisp"
:dir "/tmp/test"
:literal nil)
rg-cur-search))
(rg-rerun-change-literal)
(should (cl-every 'equal
(rg-search-create :pattern "new-pattern"
:files "elisp"
:dir "/tmp/test"
:literal t)
rg-cur-search))
(should (equal
(rg-search-create :pattern "new-pattern"
:files "elisp"
:dir "/tmp/test"
:literal t)
rg-cur-search))
(rg-rerun-change-regexp)
(should (eq (rg-search-literal rg-cur-search) nil)))))

Expand Down Expand Up @@ -132,15 +132,15 @@ on emacs version."
(cl-letf (((symbol-function #'rg-rerun) #'ignore)
((symbol-function #'completing-read) (lambda (&rest _) "cpp")))
(rg-rerun-change-files)
(should (cl-every 'equal (rg-search-new "regexp" "cpp" "/tmp/test") rg-cur-search)))))
(should (equal (rg-search-new "regexp" "cpp" "/tmp/test") rg-cur-search)))))

(ert-deftest rg-unit-test/rerun-change-dir ()
"Test result of `rg-rerun-change-dir'."
(let ((rg-cur-search (rg-search-new "regexp" "elisp" "/tmp/test")))
(cl-letf (((symbol-function #'rg-rerun) #'ignore)
((symbol-function #'read-directory-name) (lambda (&rest _) "/tmp/new")))
(rg-rerun-change-dir)
(should (cl-every 'equal (rg-search-new "regexp" "elisp" "/tmp/new") rg-cur-search)))))
(should (equal (rg-search-new "regexp" "elisp" "/tmp/new") rg-cur-search)))))

(ert-deftest rg-unit-test/custom-toggle ()
"Test `rg-define-toggle' macro."
Expand Down Expand Up @@ -664,20 +664,20 @@ and ungrouped otherwise."
(setf (rg-search-toggle-flags rg-cur-search) '("--text"))
(rg-rerun))
(should (rg-wait-for-search-result))
(should (cl-every 'equal
(list "Hello" "all" parent-dir)
(list (rg-search-pattern rg-cur-search)
(rg-search-files rg-cur-search)
(rg-search-dir rg-cur-search))))
(should (cl-every 'equal '("--text") (rg-search-toggle-flags rg-cur-search)))
(should (equal
(list "Hello" "all" parent-dir)
(list (rg-search-pattern rg-cur-search)
(rg-search-files rg-cur-search)
(rg-search-dir rg-cur-search))))
(should (equal '("--text") (rg-search-toggle-flags rg-cur-search)))
(rg-recompile)
(should (rg-wait-for-search-result))
(should (cl-every 'equal
(list "Hello" "all" parent-dir)
(list (rg-search-pattern rg-cur-search)
(rg-search-files rg-cur-search)
(rg-search-dir rg-cur-search))))
(should (cl-every 'equal '("--text") (rg-search-toggle-flags rg-cur-search))))))
(should (equal
(list "Hello" "all" parent-dir)
(list (rg-search-pattern rg-cur-search)
(rg-search-files rg-cur-search)
(rg-search-dir rg-cur-search))))
(should (equal '("--text") (rg-search-toggle-flags rg-cur-search))))))

(ert-deftest rg-integration/display-exit-message ()
"Verify exit messages."
Expand Down

0 comments on commit b161fe1

Please sign in to comment.