-
Notifications
You must be signed in to change notification settings - Fork 347
Honour curly braces in target sections #933
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
Conversation
Have you though about creating a couple of test cases for this functionality? It seems way more complicated than it was expected initially. |
Well, the change itself is actually not complicated. Split target name on space, take head and replace with "library" if head is "empty". Also, not sure if What say you? |
Writing some unit tests for this doesn't take much time and is pretty easy task. There is no excuse to not do this. |
I made a (ert-deftest haskell-cabal-enum-targets-1 ()
"Test enumerating .cabal targets."
(with-temp-buffer
(haskell-cabal-mode)
(setq default-directory (expand-file-name "./test-data/"))
(should (equal '("library" "test-1" "bench-1" "bin-1")
(haskell-cabal-enum-targets)))))
|
Thanks. |
Test is updated in the fix as well. Or do you mean to test the whole process, with |
I thought about having a couple different xxx.cabal files, but now I see that you have covered all cases wit one cabal file. Seems good enough. Can you quash all 4 commits into 2: one with functionality and one with the tests? We will merge when you do this. |
Hmm, branch has conflicts, github does not allow me to merge it. Can you try to rebase again on top of master? |
Honour curly braces in target sections
Thanks. |
Accept target sections written with curly braces, i.e. remove them from targets listing.
Fixes #534.