Skip to content

Conversation

@geraldus
Copy link
Contributor

Let's move a little by little. This is starting point for completion package.

I'm unsatisfied with tests because when some assertions are failed it's quite hard to find which one is actual culprit. I'd rather split all tests into separate functions, but this will bring a lot of boilerplate code. I've looked at defmacro and haskell-indentation-check function but have found no good replacement yet and gave up. So, let's merge this as is, and improve tests later.

Related #688

gracjan added a commit that referenced this pull request Jun 12, 2015
Completions package (step 0: no functions yet)
@gracjan gracjan merged commit 8b504d9 into haskell:master Jun 12, 2015
@gracjan
Copy link
Contributor

gracjan commented Jun 12, 2015

About test:

What I usually define is a test helper function that is used like this:

(defun check-can-grab-prefix (lines expected-result)
    (with-buffer
       (insert-lines)
       (find-where-is-$-and-place-cursor-there)
       (remove-$)
       (should (equal expected-result (haskell-completions-can-grab-prefix))))

(ert-deftest haskell-completions-can-grab-prefix-test () 
   "Test testing foobar"
   (check-can-grab-prefix
      '("{-# LANG$ #-}"  ;; input lines, $ is where cursor should be, $ is removed after placing cursor there
        "Other line")
      t)                 ;; or nil, this is the expected result 

@geraldus geraldus deleted the completions-package branch June 12, 2015 06:57
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.

2 participants