From 0a46429a1628fd10437c227dbed272ba50932f3f Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Thu, 12 Jan 2023 22:14:50 +0000 Subject: [PATCH] Replace space with dash for function name --- config.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config.el b/config.el index c37970e..aa53deb 100644 --- a/config.el +++ b/config.el @@ -358,11 +358,18 @@ the description. This may destroy existing links, or change their targets so use (message "Renamed %s to %s." old-name new-name))) (message "No symbol under cursor.")))) +;; tests are better than literate programming when you want to triangulate on the same function +;; org only shows the last return value by default, you can return a list of course, but still (defun as-function-name (candidate-name) - candidate-name) + "Take the string and make it suitable to be a function name" + (declare (side-effect-free t)) + (candidate-name) (ert-deftest refactor-rename-should-leave-forward-slash() (should (equal (as-function-name "qwan/echo") "qwan/echo"))) +(ert-deftest refactor-rename-should-replace-space-with-dash() + (should (equal (as-function-name "qwan/echo chamber") + "qwan/echo-chamber"))) (ert "refactor.*")