Permalink
Browse files

Add some tests for "%FILL[prefix]{...}" and "%FOLD[prefix]{...}".

* test/test-twittering-mode.el: Add some tests for the format
specifiers "%FILL[prefix]{...}" and "%FOLD[prefix]{...}".
* twittering-mode.el (twittering-status-format): add a document
for the format specifier "%FOLD[prefix]{...}".
  • Loading branch information...
1 parent a648839 commit ea9d9cd5f09c050c9334daec6f11721886edddd0 @cvmat cvmat committed Jan 23, 2011
Showing with 39 additions and 1 deletion.
  1. +5 −0 ChangeLog
  2. +32 −0 test/test-twittering-mode.el
  3. +2 −1 twittering-mode.el
View
@@ -1,5 +1,10 @@
2011-01-23 Tadashi MATSUO <tad@mymail.twin.jp>
+ * test/test-twittering-mode.el: Add some tests for the format
+ specifiers "%FILL[prefix]{...}" and "%FOLD[prefix]{...}".
+ * twittering-mode.el (twittering-status-format): add a document
+ for the format specifier "%FOLD[prefix]{...}".
+
* test/test-twittering-mode.el: Fix an error of
`url-generic-parse-url' on Emacs21 by calling
`url-scheme-get-property' before `url-generic-parse-url' is called.
@@ -353,6 +353,38 @@
(let ((twittering-icon-mode t)
(window-system t))
(format-status status "%i %s, :\n %T // from %f%L%r")))
+
+ (test-assert-string-equal
+ "
+ Help protect and support Free Software and the GNU Project by joining the
+ Free Software Foundation! http://www.fsf.org/join?referrer=7019 // from web"
+ (let ((twittering-fill-column 80))
+ (format-status status "\n%FILL[ ]{%T // from %f%L%r}")))
+
+ (test-assert-string-equal
+ "
+ Help protect and support Free Software and the GNU Project by joining the
+ Free Software Foundation! http://www.fsf.org/join?referrer=7019 // from web"
+ (let ((twittering-fill-column 80))
+ (format-status status "\n%FOLD[ ]{%T // from %f%L%r}")))
+
+ (test-assert-string-equal
+ "
+ Edit XHTML5 documents in nxml-mode with on-the-fly validation:
+ http://bit.ly/lYnEg (by @hober) // from web"
+ (let ((twittering-fill-column 80)
+ (oldest-status (car (last (get-fixture 'timeline-data)))))
+ (format-status oldest-status "\n%FILL[ ]{%T // from %f%L%r}")))
+
+ (test-assert-string-equal
+ "
+--Edit XHTML5 documents in nxml-mode with on-the-fly validation:
+--http://bit.ly/lYnEg
+--
+-- (by @hober) // from web"
+ (let ((twittering-fill-column 80)
+ (oldest-status (car (last (get-fixture 'timeline-data)))))
+ (format-status oldest-status "\n%FOLD[--]{%T // from %f%L%r}")))
))
(defcase test-find-curl-program nil nil
View
@@ -267,7 +267,8 @@ Items:
%FILL[prefix]{...} - strings filled as a paragraph. The prefix is optional.
You can use any other specifiers in braces.
%FOLD[prefix]{...} - strings folded within the frame width.
- The prefix is optional. This keeps newlines.
+ The prefix is optional. This keeps newlines and does not
+ squeeze a series of white spaces.
You can use any other specifiers in braces.
%f - source
%# - id

0 comments on commit ea9d9cd

Please sign in to comment.