From d0e8bddad0e6785049068703d97417f5a2793e3c Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 13 Dec 2004 06:30:42 +0000 Subject: [PATCH] * test/Makefile.am (EXTRA_DIST): Add test-riece.el. * test/test-riece.el: New test cases. * riece.el (riece-shrink-buffer): Fixed bug. --- lisp/ChangeLog | 5 +++++ lisp/riece.el | 3 ++- lisp/test/Makefile.am | 4 ++-- lisp/test/test-riece.el | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 lisp/test/test-riece.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 47f548f..983ca5e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2004-12-13 Daiki Ueno + * test/Makefile.am (EXTRA_DIST): Add test-riece.el. + * test/test-riece.el: New test cases. + + * riece.el (riece-shrink-buffer): Fixed bug. + * riece-options.el (riece-username): Changed the default value to user-full-name. diff --git a/lisp/riece.el b/lisp/riece.el index b7c18eb..aece645 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -339,7 +339,8 @@ If optional argument CONFIRM is non-nil, ask which IRC server to connect." buffer-read-only (end (progn (goto-char riece-shrink-buffer-remove-chars) - (beginning-of-line 2))) + (beginning-of-line 2) + (point))) (overlays (riece-overlays-in (point-min) end))) (while overlays (riece-delete-overlay (car overlays)) diff --git a/lisp/test/Makefile.am b/lisp/test/Makefile.am index 1ca877b..3c59516 100644 --- a/lisp/test/Makefile.am +++ b/lisp/test/Makefile.am @@ -1,3 +1,3 @@ EXTRA_DIST = luna.el lunit.el lunit-report.el \ - test-riece-addon.el test-riece-alias.el test-riece-log.el \ - test-riece-url.el test-riece-yank.el \ No newline at end of file + test-riece.el test-riece-addon.el test-riece-alias.el \ + test-riece-log.el test-riece-url.el test-riece-yank.el \ No newline at end of file diff --git a/lisp/test/test-riece.el b/lisp/test/test-riece.el new file mode 100644 index 0000000..d5d2cbc --- /dev/null +++ b/lisp/test/test-riece.el @@ -0,0 +1,19 @@ +(require 'riece) + +(luna-define-class test-riece (lunit-test-case)) + +(luna-define-method test-riece-shrink-buffer ((case test-riece)) + (let* ((riece-max-buffer-size 255) + (riece-shrink-buffer-remove-chars 128) + (line (concat (make-string 15 ? ) "\n")) + (index 0)) + (with-temp-buffer + (while (< index 16) + (insert line) + (setq index (1+ index))) + (riece-shrink-buffer (current-buffer)) + (lunit-assert-2 + case + (equal + (apply #'concat (make-list 8 line)) + (buffer-string)))))) -- 1.7.10.4