liquidz / vim-iced

Clojure Interactive Development Environment for Vim8/Neovim
https://liquidz.github.io/vim-iced/
MIT License
518 stars 35 forks source link

Trouble getting correct testing filename #356

Closed bootleq closed 3 years ago

bootleq commented 3 years ago

Hi, I am not sure this is an vim-iced issue, but in some situation the filename reported after iced#nrepl#op#cider#test_var_query is incorrect.

  1. With IcedTestUnderCursor, I always get {vim's pwd}/NO_SOURCE_FILE.
  2. With IcedTestNs, it is good if vim's pwd is the project root, but if not, I get fullpath with "vim pwd" + "path relate to vim pwd" (i.e., the part between pwd and testing file, is incorrectly repeated).

And though the filename has problem, the lnum is always good.

In higher level of view, my problem is after running test with test error, I can't get error sign placed, nor correct cwindow listing.

If my info is not helpful (sorry about that), would it be okay to add line number to error output? Like ;; some-err-text :42? Current output is in ;; some-err-text format, as defined at https://github.com/liquidz/vim-iced/blob/979346980fb045db8c6073f995bcb2dc25a94e43/autoload/iced/nrepl/test.vim#L42

liquidz commented 3 years ago

@bootleq Thanks for your reporting!

Hmm.. It is no problem in my environment, and I have no idea about the cause. Is it possible to tell me minimal steps to reproduce the problem with minimal configuration?

If my info is not helpful (sorry about that), would it be okay to add line number to error output? Like ;; some-err-text :42?

It's OK, but it is better to clarify that the number is a line number like ;; some-err-text (Line: 42) Colon separated message may be confused in the followin case.

(deftest a-test
  (testing "FIXME, I fail."
    (is (= 0 1))))
;; => error output will be "a-test: FIXME, I fail."
bootleq commented 3 years ago

Is it possible to tell me minimal steps to reproduce the problem with minimal configuration?

I've created a testing project https://github.com/bootleq/vim_iced_debug_boilerplate Follow the README should be able to reproduce my situation.

It's OK, but it is better to clarify that the number is a line number like ;; some-err-text (Line: 42) Colon separated message may be confused in the followin case.

Agree, I am willing to try and prepare a PR later, thank you.

liquidz commented 3 years ago

@bootleq Thanks! I confirmed to reproduce the problem.

In your testing project, there are 2 problems.

With above corrections, I can confirm to work correctly in my environment.

bootleq commented 3 years ago

In your testing project, there are 2 problems.

Thank you very much! I can confirm that is the real cause.