From: Eric Ludlam Date: Sat, 20 Aug 2011 17:04:00 +0000 (-0400) Subject: Add header comments and provide. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bc36c86b7b21abf9649b2c3299d9cea6bc4d1637;p=emacs.git Add header comments and provide. --- diff --git a/test/manual/cedet/pulse-utest.el b/test/manual/cedet/pulse-utest.el new file mode 100644 index 00000000000..6d838f264e5 --- /dev/null +++ b/test/manual/cedet/pulse-utest.el @@ -0,0 +1,78 @@ +;;; pulse-utest.el --- Tests for Pulse. +;; +;; Copyright (C) 2011 Eric M. Ludlam +;; +;; Author: Eric M. Ludlam +;; +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see http://www.gnu.org/licenses/. + + +;;; Commentary: +;; +;; + +(require 'pulse) + +;;; Code: + +(defun pulse-test (&optional no-error) + "Test the lightening function for pulsing a line. +When optional NO-ERROR Don't throw an error if we can't run tests." + (interactive) + (if (or (not pulse-flag) (not (pulse-available-p))) + (if no-error + nil + (error (concat "Pulse test only works on versions of Emacs" + " that support pulsing"))) + ;; Run the tests + (when (cedet-called-interactively-p) + (message " Pulse one line.") + (read-char)) + (pulse-momentary-highlight-one-line (point)) + (when (cedet-called-interactively-p) + (message " Pulse a region.") + (read-char)) + (pulse-momentary-highlight-region (point) + (save-excursion + (condition-case nil + (forward-char 30) + (error nil)) + (point))) + (when (cedet-called-interactively-p) + (message " Pulse line a specific color.") + (read-char)) + (pulse-momentary-highlight-one-line (point) 'modeline) + (when (cedet-called-interactively-p) + (message " Pulse a pre-existing overlay.") + (read-char)) + (let* ((start (point-at-bol)) + (end (save-excursion + (end-of-line) + (when (not (eobp)) + (forward-char 1)) + (point))) + (o (pulse-make-overlay start end)) + ) + (pulse-momentary-highlight-overlay o) + (if (pulse-overlay-live-p o) + (pulse-overlay-delete o) + (error "Non-temporary overlay was deleted!")) + ) + (when (cedet-called-interactively-p) + (message "Done!")))) + + +(provide 'pulse-utest) + +;;; pulse.el ends here