-
Notifications
You must be signed in to change notification settings - Fork 7
/
test_aider.el
23 lines (20 loc) · 1.35 KB
/
test_aider.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(require 'ert)
(ert-deftest aider-buffer-name-from-git-repo-path-test ()
"Test the aider-buffer-name-from-git-repo-path function."
(should (equal (aider-buffer-name-from-git-repo-path "/Users/username/git/repo" "/Users/username")
"*aider:~/git/repo*"))
(should (equal (aider-buffer-name-from-git-repo-path "/home/username/git/repo" "/home/username")
"*aider:~/git/repo*"))
(should (equal (aider-buffer-name-from-git-repo-path "/Users/username/git/repo/subdir" "/Users/username")
"*aider:~/git/repo/subdir*"))
(should (equal (aider-buffer-name-from-git-repo-path "/home/username/git/repo/subdir" "/home/username")
"*aider:~/git/repo/subdir*")))
(ert-deftest test-aider-region-refactor-generate-command ()
"Test the aider-region-refactor-generate-command function."
(should (equal (aider-region-refactor-generate-command "some code"
"my-function" "refactor this")
"/architect \"in function my-function, for the following code block, refactor this: some code\"\n"))
(should (equal (aider-region-refactor-generate-command "some code" nil
"make it more functional")
"/architect \"for the following code block, make it more functional: some code\"\n"))
)