Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.
84 stars 39 forks source link

Add a test for Issue 56 that appears to fail in some circumstances. #67

Closed russel closed 7 years ago

russel commented 7 years ago

It is not yet clear what and why.

Issue #66 relates to this.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 59.434% when pulling 8f79379b3baf5997fdd511b877df9af98f20ec08 on russel:issue-56-issue into 58bb858d77cf5e61ee392a1ca415a90298d77e4b on Groovy-Emacs-Modes:master.

Wilfred commented 7 years ago

I suspect the problem is that your test depends on the value of indent-tabs-mode. Looking at the message on Travis:

Test test-for-issue-56 condition:
    (ert-test-failed
    ...
      :value nil :explanation
      (arrays-of-different-length 106 155 "class foo {
    def bar() {
    def a = 1
    def b = a +
        1
    def c =
        1
    def d = a
        .baz()
    }
}
" "class foo {
    def bar() {
        def a = 1
        def b = a +
            1
        def c =
            1
        def d = a
            .baz()
    }
}
" first-mismatch-at 28)))
F..
Ran 9 tests in 0.034 seconds
1 unexpected results:
   FAILED  test-for-issue-56

Note how the two versions look identical, but Emacs reports the strings having different lengths.

I think your test should work as expected if you use should-indent. See also 55d337f124aa0b38d0b92e84fc1b41b6012f38bf.

Wilfred commented 7 years ago

@russel I don't think there are any bugs here, just a test that's sensitive to tab settings. We haven't resolved all the indentation issues in #61, but I don't think there are any additional issues in this PR.

Happy to reopen if you disagree.

russel commented 7 years ago

I guess then this test needs running twice, once with tabs set to four space and once with tabs set to tab. I guess the question is how to enforce the tab setting?