* test/test-riece.el: New test cases.
* riece.el (riece-shrink-buffer): Fixed bug.
2004-12-13 Daiki Ueno <ueno@unixuser.org>
+ * 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.
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))
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
--- /dev/null
+(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))))))