[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 15/28: Fix the tests
From: |
Dmitry Gutov |
Subject: |
[elpa] 15/28: Fix the tests |
Date: |
Wed, 27 Aug 2014 01:26:28 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 5f64175f54e9d003cef8cde4f80c395681caeb41
Author: Dmitry Gutov <address@hidden>
Date: Mon Aug 18 05:23:27 2014 +0400
Fix the tests
---
company-tests.el | 40 ++++++++++++++++++++++++++--------------
1 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/company-tests.el b/company-tests.el
index fd2a42b..898fb92 100644
--- a/company-tests.el
+++ b/company-tests.el
@@ -30,6 +30,9 @@
(require 'company-keywords)
(require 'company-clang)
+(defun company--column (&optional pos)
+ (car (company--col-row pos)))
+
;;; Core
(ert-deftest company-sorted-keywords ()
@@ -415,7 +418,7 @@
;; FIXME: Make it 2?
(should (eq (overlay-get ov 'company-height) company-tooltip-limit))
(should (eq (overlay-get ov 'company-column) col))
- (should (string= (overlay-get ov 'company-after)
+ (should (string= (overlay-get ov 'company-display)
" 123 \nc 45 c\nddd\n")))))))
(ert-deftest company-pseudo-tooltip-edit-updates-width ()
@@ -465,7 +468,7 @@
(let ((ov company-pseudo-tooltip-overlay))
;; With margins.
(should (eq (overlay-get ov 'company-width) 8))
- (should (string= (overlay-get ov 'company-after)
+ (should (string= (overlay-get ov 'company-display)
" 123(4) \n 45 \n")))))))
(ert-deftest company-pseudo-tooltip-show-with-annotations-right-aligned ()
@@ -486,7 +489,7 @@
(let ((ov company-pseudo-tooltip-overlay))
;; With margins.
(should (eq (overlay-get ov 'company-width) 13))
- (should (string= (overlay-get ov 'company-after)
+ (should (string= (overlay-get ov 'company-display)
" 123 (4) \n 45 \n 67 (891011)
\n")))))))
(ert-deftest company-create-lines-shows-numbers ()
@@ -556,23 +559,32 @@
)))
(ert-deftest company-column-with-composition ()
+ :tags '(interactive)
(with-temp-buffer
- (insert "lambda ()")
- (compose-region 1 (1+ (length "lambda")) "\\")
- (should (= (company--column) 4))))
+ (save-window-excursion
+ (set-window-buffer nil (current-buffer))
+ (insert "lambda ()")
+ (compose-region 1 (1+ (length "lambda")) "\\")
+ (should (= (company--column) 4)))))
(ert-deftest company-column-with-line-prefix ()
+ :tags '(interactive)
(with-temp-buffer
- (insert "foo")
- (put-text-property (point-min) (point) 'line-prefix " ")
- (should (= (company--column) 5))))
+ (save-window-excursion
+ (set-window-buffer nil (current-buffer))
+ (insert "foo")
+ (put-text-property (point-min) (point) 'line-prefix " ")
+ (should (= (company--column) 5)))))
-(ert-deftest company-column-wth-line-prefix-on-empty-line ()
+(ert-deftest company-column-with-line-prefix-on-empty-line ()
+ :tags '(interactive)
(with-temp-buffer
- (insert "\n")
- (forward-char -1)
- (put-text-property (point-min) (point-max) 'line-prefix " ")
- (should (= (company--column) 2))))
+ (save-window-excursion
+ (set-window-buffer nil (current-buffer))
+ (insert "\n")
+ (forward-char -1)
+ (put-text-property (point-min) (point-max) 'line-prefix " ")
+ (should (= (company--column) 2)))))
(ert-deftest company-plainify ()
(let ((tab-width 8))
- [elpa] 11/28: Use window-screen-lines when available, (continued)
- [elpa] 11/28: Use window-screen-lines when available, Dmitry Gutov, 2014/08/26
- [elpa] 05/28: company--show-inline-p: never ignore case, Dmitry Gutov, 2014/08/26
- [elpa] 12/28: Tweak wording, Dmitry Gutov, 2014/08/26
- [elpa] 13/28: Use `posn-actual-col-row' to determine the current col and row, Dmitry Gutov, 2014/08/26
- [elpa] 14/28: Work around http://debbugs.gnu.org/18285, Dmitry Gutov, 2014/08/26
- [elpa] 16/28: company-buffer-lines: handle multiline display better, Dmitry Gutov, 2014/08/26
- [elpa] 17/28: company-input-noop still seems to be needed in the terminal, Dmitry Gutov, 2014/08/26
- [elpa] 18/28: Skip company-buffer-lines tests in terminal, Dmitry Gutov, 2014/08/26
- [elpa] 19/28: company-pseudo-tooltip-unhide: use local vars, Dmitry Gutov, 2014/08/26
- [elpa] 20/28: company-pseudo-tooltip-unhide: fix rendering at eob, Dmitry Gutov, 2014/08/26
- [elpa] 15/28: Fix the tests,
Dmitry Gutov <=
- [elpa] 21/28: Add a comment, Dmitry Gutov, 2014/08/26
- [elpa] 22/28: company--capf-data: use caching, Dmitry Gutov, 2014/08/26
- [elpa] 24/28: Use `company-dabbrev-ignore-case' when searching for candidates, Dmitry Gutov, 2014/08/26
- [elpa] 25/28: Document `company-dabbrev-ignore-case' better, Dmitry Gutov, 2014/08/26
- [elpa] 26/28: company-dabbrev-code-ignore-case: rephrase a bit, Dmitry Gutov, 2014/08/26
- [elpa] 27/28: Bump the version, Dmitry Gutov, 2014/08/26
- [elpa] 28/28: Merge commit 'f4ffe2b47cf6854ff3bc3ca1717efe1258c01547' from company, Dmitry Gutov, 2014/08/26
- [elpa] 23/28: Fix WRT `keep-prefix', Dmitry Gutov, 2014/08/26