Skip to content

Commit 399f952

Browse files
committed
Fix and add tests for startup directory mechanism
1 parent 2e1809a commit 399f952

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/ess-test-r.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,21 @@ x <- function(x){
687687
(comint-next-prompt 1)
688688
(should (equal (line-number-at-pos) 3)))
689689

690+
(ert-deftest ess-test-r-startup-directory ()
691+
(let ((proj-dir (expand-file-name ".."))
692+
(cur-dir (directory-file-name (expand-file-name default-directory))))
693+
(let ((ess-startup-directory nil))
694+
(with-r-running nil
695+
(with-current-buffer (ess-get-process-buffer)
696+
(should (string= proj-dir (directory-file-name (expand-file-name default-directory)))))))
697+
(let ((ess-startup-directory 'default-directory))
698+
(with-r-running nil
699+
(with-current-buffer (ess-get-process-buffer)
700+
(should (string= cur-dir (directory-file-name (expand-file-name default-directory)))))))))
701+
690702
(ert-deftest ess-test-r-comint-input-ring-file-name ()
691703
(let ((ess-history-file t)
704+
(ess-startup-directory 'default-directory) ; don't start in the project
692705
ess-history-directory)
693706
(with-r-running nil
694707
(should (string= (expand-file-name ".Rhistory" default-directory)

0 commit comments

Comments
 (0)