Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8041/tests
Modified Files:
string.pure.lisp
Log Message:
1.0.17.42: more string trimming fixes
* Return value in the no-op case for non-simple-strings must not be
the underlying simple string object.
* Correct return type (per spec) for STRING-TRIM &co is
STRING-DESIGNATOR, but as long as we take care, we can make it
STRING -- but the old SIMPLE-STRING is still wrong.
* Instead of making WITH-STRING a full-blown Evil Macro, just use
WITH-ARRAY-DATA at the call site.
* Two more test-cases.
patch by James Knight.
Index: string.pure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/string.pure.lisp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- string.pure.lisp 3 Jun 2008 16:00:16 -0000 1.8
+++ string.pure.lisp 24 Jun 2008 17:12:59 -0000 1.9
@@ -137,3 +137,11 @@
(assert (equal "bc" (string-right-trim "ab" s)))
(assert (equal "bca" s))
(assert (equal "abcaeb" s0)))
+
+;;; Trimming non-simple-strings when there is nothing to do
+(let ((a (make-array 10 :element-type 'character :initial-contents "abcde00000" :fill-pointer 5)))
+ (assert (equal "abcde" (string-right-trim "Z" a))))
+
+;;; Trimming non-strings when there is nothing to do.
+(string-right-trim " " #\a)
+
|