Skip to content
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

Test fails(el-spec) in Emacs 24.1 #5

Open
uk-ar opened this issue Aug 8, 2012 · 7 comments
Open

Test fails(el-spec) in Emacs 24.1 #5

uk-ar opened this issue Aug 8, 2012 · 7 comments

Comments

@uk-ar
Copy link
Owner

uk-ar commented Aug 8, 2012

No description provided.

@pogin503
Copy link
Contributor

pogin503 commented Aug 8, 2012

すみません遅くなりました。
結果を貼っておきます。

あとコミットしたやつも貼っておきます。
https://github.com/ogin503/flex-autopair/commit/7112a5cf2e0876cbae65e2dffa6b5a8788ac2007

ac-handle-post-commandがエラーになっているのでauto-completeが古いのが原因かもしれません。調べてみます。

GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
of 2012-06-11 on bitzer.hoetzel.info

el-specのテスト結果:

Selector: t
Passed: 45
Failed: 8 (8 unexpected)
Total:  53/53

Started at:   2012-08-08 11:25:12+0900
Finished.
Finished at:  2012-08-08 11:25:14+0900

F...F...F.................F..FFFF....................

F flex-autopair in temp-buffer
((c-mode) (should (memq (quote flex-autopair-post-command-function) post-command-hook)))
    (ert-test-failed
     ((should
       (memq 'flex-autopair-post-command-function post-command-hook))
      :form
      (memq flex-autopair-post-command-function
            (ac-handle-post-command linum-update-current t flyspell-post-command-hook))
      :value nil))

F flex-autopair in temp-buffer
in c-mode
((should (memq (quote flex-autopair-post-command-function) post-command-hook)))
    (ert-test-failed
     ((should
       (memq 'flex-autopair-post-command-function post-command-hook))
      :form
      (memq flex-autopair-post-command-function
            (ac-handle-post-command linum-update-current t flyspell-post-command-hook))
      :value nil))

F flex-autopair in temp-buffer
in c-mode
execute
((cmd "{"))
((should (string= (buffer-string) "{

}")) (should (eq (point) 5)))
    (ert-test-failed
     ((should
       (string=
        (buffer-string)
        "{\n  \n}"))
      :form
      (string= "{\n    \n}" "{\n  \n}")
      :value nil))

F flex-autopair in temp-buffer
in default-mode
insert & move & execute
((cmd ")") (pos 2) (pre-string "()"))
((should (string= (buffer-string) "())")) (should (eq (point) 3)))
    (ert-test-failed
     ((should
       (string=
        (buffer-string)
        "())"))
      :form
      (string= "()" "())")
      :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((exchange-point-and-mark) (execute-kbd-macro "(") (should (string= (buffer-string) "(word)")) (should (eq (point) 2)))
    (ert-test-failed
     ((should
       (string=
        (buffer-string)
        "(word)"))
      :form
      (string= "()" "(word)")
      :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((execute-kbd-macro "(") (should (string= (buffer-string) "(word)")) (should (eq (point) 2)))
    (ert-test-failed
     ((should
       (string=
        (buffer-string)
        "(word)"))
      :form
      (string= "()" "(word)")
      :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((execute-kbd-macro ")") (should (string= (buffer-string) "word)")) (should (eq (point) 6)))
    (ert-test-failed
     ((should
       (string=
        (buffer-string)
        "word)"))
      :form
      (string= ")" "word)")
      :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((execute-kbd-macro "\"") (should (string= (buffer-string) "\"word\"")) (should (eq (point) 2)))
    (ert-test-failed
     ((should
       (string=
        (buffer-string)
        "\"word\""))
      :form
      (string= "\"\"" "\"word\"")
      :value nil))

@uk-ar
Copy link
Owner Author

uk-ar commented Aug 8, 2012

ありがとうございます。変更点には何も問題なさそうですね。
詳しく追うのは夜になりますが、ぱっと見たところ特定のモードでflex-autopair-modeがオフになってるみたいです(auto-completeは問題ない気がします)。テストケース自体も怪しい気がしてます。
参考のため、(.emacsなどの)flex-autopair関係の設定も教えてもらえるとうれしいです。

@pogin503
Copy link
Contributor

pogin503 commented Aug 8, 2012

設定は特に影響を与えていないようです。設定ファイルなしでやってみても失敗箇所は変わりませんでした。

40_init-flex-autopair.el:

(require 'flex-autopair)
(flex-autopair-mode 1)


(defun my-haskell-hook-function1 ()
  (add-to-list 'flex-autopair-pairs '(?\' . ?\')))

(add-hook 'haskell-mode-hook 'my-haskell-hook-function1)

(defun my-flex-sh-pair ()
  (add-to-list 'flex-autopair-pairs '(?\[ . ?\])))

(add-hook 'sh-mode-hook 'my-flex-sh-pair)


(setq flex-autopair-user-conditions-high
      `(
        ((and
          (eq last-command-event ?')
          ;; (if (numberp (save-excursion (re-search-backward "[^ ]" (- (point) 1) t))) t nil)
          ;; カーソルの後ろが空白以外ならばシングルクオート自身を挿入する
          (save-excursion (re-search-backward "[^ ]" (- (point) 1) t))
          (memq major-mode flex-autopair-functional-modes))
         . self)
        ((and
          (eq major-mode 'sh-mode)
          (eq last-command-event ?[ )
          (flex-autopair-execute-macro
           (format "%c `!!' %c" opener closer)))
         . pair-in-two-spaces)
        ))

(flex-autopair-reload-conditions)

あとでpull requestを送ります。

@uk-ar
Copy link
Owner Author

uk-ar commented Aug 8, 2012

環境がEmacs 24.1だったんですね。
だいたい再現できました。
原因はテストが24.1に対応できていなかったからのようです(とりあえずの動作は問題ない?)
待たせてしまうのもアレなので、機能拡張の件はEmacs 23でテスト結果を確認できたらmergeしようと思います。
テストの24.1対応の件は引き続き調査をしてみます。

@pogin503
Copy link
Contributor

pogin503 commented Aug 8, 2012

原因はEmacs24.1だったからなのですね...。
機能拡張?ってどれのことでしょう。修正の方なんでしょうか。
とにかくコミットをまとめたやつを送ってみます。

@uk-ar
Copy link
Owner Author

uk-ar commented Aug 9, 2012

テストが通るように修正してみましたので、もう一度試してもらえるとありがたいです。
リージョン選択時に元の選択文字列が消えているようですが、delete-selection-modeを使ってると考えてよかったですか?
(使ってる場合は55d1287#L0R561 の部分のテストを実行しないようにしました)

@pogin503
Copy link
Contributor

すみません、試すのが遅くなりました。

delete-selection-modeをevalしてみたところnilになっていました。

ダウンロードして実行してみたところテストの方は通りませんでした...。

インデントの設定が原因かと思って見たところなんだか違うようです。

tab-stop-listを変更しているからうまく行かないのかもしれないのでそっちも調べてみます。
=>tab-stop-listも関係無いようです...。

delete-selection-mode disable の時

Selector: t
Passed: 49
Failed: 5 (5 unexpected)
Total:  54/54

Started at:   2012-08-11 18:15:18+0900
Finished.
Finished at:  2012-08-11 18:15:20+0900

........F....................FFFF.....................

F flex-autopair in temp-buffer
in c-mode
execute
((cmd "{"))
((should (string-match "{
[    ]+
}" (flex-autopair-test-helper-execute cmd))) (should (eq (point) 5)))
    (ert-test-failed
         ((should
             (eq
                (point)
                5))
            :form
            (eq 7 5)
            :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((exchange-point-and-mark) (execute-kbd-macro "(") (should (string= (buffer-string) "(word)")) (should (eq (point) 2)))
    (ert-test-failed
         ((should
             (string=
                (buffer-string)
                "(word)"))
            :form
            (string= "()" "(word)")
            :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((execute-kbd-macro "(") (should (string= (buffer-string) "(word)")) (should (eq (point) 2)))
    (ert-test-failed
         ((should
             (string=
                (buffer-string)
                "(word)"))
            :form
            (string= "()" "(word)")
            :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((execute-kbd-macro ")") (should (string= (buffer-string) "word)")) (should (eq (point) 6)))
    (ert-test-failed
         ((should
             (string=
                (buffer-string)
                "word)"))
            :form
            (string= ")" "word)")
            :value nil))

F flex-autopair in temp-buffer
in default-mode
region & execute
((execute-kbd-macro "\"") (should (string= (buffer-string) "\"word\"")) (should (eq (point) 2)))
    (ert-test-failed
         ((should
             (string=
                (buffer-string)
                "\"word\""))
            :form
            (string= "\"\"" "\"word\"")
            :value nil))

delete-selection-mode: enable のとき

Selector: t
Passed: 48
Failed: 1 (1 unexpected)
Total:  49/49

Started at:   2012-08-11 18:18:10+0900
Finished.
Finished at:  2012-08-11 18:18:12+0900

........F........................................

F flex-autopair in temp-buffer
in c-mode
execute
((cmd "{"))
((should (string-match "{
[    ]+
}" (flex-autopair-test-helper-execute cmd))) (should (eq (point) 5)))
    (ert-test-failed
         ((should
             (eq
                (point)
                5))
            :form
            (eq 7 5)
            :value nil))

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

No branches or pull requests

2 participants