[py-configparser-cvs] r27 - in trunk: . tests
ehuelsmann at common-lisp.net
ehuelsmann at common-lisp.net
Sat Mar 15 23:00:04 UTC 2008
Author: ehuelsmann
Date: Sat Mar 15 18:00:03 2008
New Revision: 27
Modified:
trunk/parser.lisp
trunk/tests/tests.lisp
Log:
Fix two more issues reported by Maciek Pasternacki <maciej at pasternacki.net>:
1) Speling error in skip-empty-line
(includes tests/tests.lisp test for empty lines)
2) ensure-section should return section reference, not its name
Modified: trunk/parser.lisp
==============================================================================
--- trunk/parser.lisp (original)
+++ trunk/parser.lisp Sat Mar 15 18:00:03 2008
@@ -31,8 +31,7 @@
(handler-case
(%get-section config section-name)
(no-section-error ()
- (add-section config section-name)))
- section-name)
+ (add-section config section-name))))
(defun is-whitespace (c)
(or (eq c #\Space)
@@ -47,7 +46,7 @@
(loop for c = (%read-char s)
while (is-whitespace c)))
-(defun skip-emtpy-line (s)
+(defun skip-empty-line (s)
(loop for c = (%read-char s)
if (eq c #\Newline) do (return)
else unless (is-whitespace c)
Modified: trunk/tests/tests.lisp
==============================================================================
--- trunk/tests/tests.lisp (original)
+++ trunk/tests/tests.lisp Sat Mar 15 18:00:03 2008
@@ -110,6 +110,17 @@
'config))
T)
+;; empty lines only
+(deftest basic.empty-lines-only
+ (with-input-from-string (s "
+
+
+")
+ (typep (get-option read-stream (make-config) s)
+ 'config))
+ T)
+
+
;; options
(deftest basic.options
(equal (with-input-from-string (s "[n]
More information about the Py-configparser-cvs
mailing list