From c5ca3b787558a7717fc724bdd122e1c70f6eda32 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Thu, 23 Sep 2004 13:36:55 +0000 Subject: [PATCH] Specialized string tests for remove-duplicates, delete-duplicates --- ansi-tests/remove-duplicates.lsp | 47 +++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/ansi-tests/remove-duplicates.lsp b/ansi-tests/remove-duplicates.lsp index 989a070d..1c59665f 100644 --- a/ansi-tests/remove-duplicates.lsp +++ b/ansi-tests/remove-duplicates.lsp @@ -268,4 +268,49 @@ (deftest delete-duplicates.error.9 (signals-error (delete-duplicates (list 'a 'b 'c) :key #'car) type-error) - t) \ No newline at end of file + t) + +;;; Specialized string tests + +(deftest remove-duplicates.string.1 + (do-special-strings + (s "abcadefabgz" nil) + (let ((s2 (remove-duplicates s))) + (assert (string= s "abcadefabgz")) + (assert (equal (array-element-type s) + (array-element-type s2))) + (assert (string= s2 "cdefabgz")))) + nil) + +(deftest remove-duplicates.string.2 + (do-special-strings + (s "abcadefabgz" nil) + (let ((s2 (remove-duplicates s :from-end t))) + (assert (string= s "abcadefabgz")) + (assert (equal (array-element-type s) + (array-element-type s2))) + (assert (string= s2 "abcdefgz")))) + nil) + +(deftest delete-duplicates.string.1 + (do-special-strings + (s "abcadefabgz" nil) + (let ((aet (array-element-type s)) + (s2 (delete-duplicates s))) + (assert (equal aet (array-element-type s2))) + (assert (string= s2 "cdefabgz")))) + nil) + +(deftest delete-duplicates.string.2 + (do-special-strings + (s "abcadefabgz" nil) + (let ((aet (array-element-type s)) + (s2 (delete-duplicates s :from-end t))) + (assert (equal aet (array-element-type s2))) + (assert (string= s2 "abcdefgz")))) + nil) + + + + + \ No newline at end of file -- GitLab