Skip to content

Commit

Permalink
Remove rg-regexp-quote
Browse files Browse the repository at this point in the history
  • Loading branch information
dajva committed Apr 4, 2018
1 parent 4f83d84 commit ef75070
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions rg.el
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,6 @@ Example:
(rg-rerun))
(message "Can't refine search since full command line search was used."))))

(defun rg-regexp-quote (regexp)
"Return an 'rg' REGEXP string which match exactly STRING and nothing else."
(replace-regexp-in-string "[][*.^\\|+?{}$()\]" "\\\\\\&" regexp))

(defun rg-apply-case-flag (pattern)
"Make sure -i is added to the command if needed.
The value of the `rg-ignore-case' variable and the case of the
Expand Down
11 changes: 0 additions & 11 deletions test/rg.el-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,6 @@ matching alias."
(should (equal "Some match" (match-string 0)))
(should (eq saved-pos (point))))))

(ert-deftest rg-unit/regexp-quote ()
"Test `rg-regexp-quote' with some 'random' strings."
(should (equal (rg-regexp-quote ")-[abs|]^$_+=(^\?)")
"\\)-\\[abs\\|\\]\\^\\$_\\+=\\(\\^\\?\\)"))
(should (equal (rg-regexp-quote "(?i)a+(?-i)b+")
"\\(\\?i\\)a\\+\\(\\?-i\\)b\\+"))
(should (equal (rg-regexp-quote "AaAaAbbBBBb")
"AaAaAbbBBBb"))
(should (equal (rg-regexp-quote "^(.*)|{}")
"\\^\\(\\.\\*\\)\\|\\{\\}")))

(ert-deftest rg-unit-test/global-keymap ()
"Test global keymap."
;; Default prefix
Expand Down

0 comments on commit ef75070

Please sign in to comment.