Skip to content

Fix for error in clojure-expected-ns. #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2015
Merged

Fix for error in clojure-expected-ns. #313

merged 1 commit into from
Aug 1, 2015

Conversation

vmfhrmfoaj
Copy link
Contributor

When call clojure-expected-ns function without arguments,
error occurred.

related commit: 4be6843

(let* ((relative (clojure-project-relative-path
(or path (file-truename (buffer-file-name)))))
(let* ((path (or path (file-truename (buffer-file-name))))
(relative (clojure-project-relative-path path))
(sans-file-type (substring relative 0 (- (length (file-name-extension path t)))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can't spot the problem, @bbatsov, path will be nil on this line when the function is called without any arguments.

@expez
Copy link
Member

expez commented Jul 30, 2015

Thanks for fixing this.

Testing this function was surprisingly hard due to the myriad calls against some current state in emacs. Ironically this bug was introduced when I refactored the function to make it easier to test :/

(should (string= (clojure-expected-ns clj-file-path) clj-file-ns)))))
(should (string= (clojure-expected-ns clj-file-path) clj-file-ns))))

(ert-deftest expected-ns-2 ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a descriptive name for the test. :-)

@bbatsov
Copy link
Member

bbatsov commented Aug 1, 2015

Drop the . from the commit message's title.

When call `clojure-expected-ns` function without arguments,
error occured.
@vmfhrmfoaj
Copy link
Contributor Author

I was changed a commit message and test name.

bbatsov added a commit that referenced this pull request Aug 1, 2015
Fix for error in `clojure-expected-ns`.
@bbatsov bbatsov merged commit 82e75a0 into clojure-emacs:master Aug 1, 2015
@bbatsov
Copy link
Member

bbatsov commented Aug 1, 2015

👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants