diff tests/automated/lisp-tests.el @ 5035:b1e48555be7d

Add a new optional ESCAPE-CHAR argument to #'split-string-by-char. src/ChangeLog addition: 2010-02-07 Aidan Kehoe <kehoea@parhasard.net> * fns.c (split_string_by_ichar_1): Extend this to take UNESCAPE and ESCAPECHAR arguments. (split_external_path, split_env_path, Fsplit_string_by_char) (Fsplit_path): Pass the new arguments to split_string_by_ichar_1(); take a new optional argument, ESCAPE-CHAR, in #'split-string-by-char, allowing SEPCHAR to be escaped. tests/ChangeLog addition: 2010-02-07 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el (split-string-by-char): Test this function, and its new ESCAPE-CHAR argument.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 07 Feb 2010 12:24:03 +0000
parents 1b96882bdf37
children 9624523604c5
line wrap: on
line diff
--- a/tests/automated/lisp-tests.el	Fri Feb 19 23:21:27 2010 +0000
+++ b/tests/automated/lisp-tests.el	Sun Feb 07 12:24:03 2010 +0000
@@ -1,4 +1,4 @@
-;; Copyright (C) 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1998 Free Software Foundation, Inc. -*- coding: iso-8859-1 -*-
 
 ;; Author: Martin Buchholz <martin@xemacs.org>
 ;; Maintainer: Martin Buchholz <martin@xemacs.org>
@@ -1077,6 +1077,76 @@
 	       '("foobar"))
 
 ;;-----------------------------------------------------
+;; Test split-string-by-char
+;;-----------------------------------------------------
+
+(Assert
+ (equal
+  (split-string-by-char
+   #r"re\:ee:this\\is\\text\\\\:oo\ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzufluß versiegt oder abgeleitet wird. Aus dem Wasser,
+worüber der Geist Gottes schwebte, wird Sumpf und Moder, worüber die
+unreinen\: Geister brüten.\\
+tocopherol
+Vitamin E: any or all of a group of closely related fat-soluble compounds
+that occur especially in plant oils and are anti-oxidants essential in the
+diets of many animals and probably of man. "
+  ?: ?\\)
+  '("re:ee" "this\\is\\text\\\\" "oops" "
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzufluß versiegt oder abgeleitet wird. Aus dem Wasser,
+worüber der Geist Gottes schwebte, wird Sumpf und Moder, worüber die
+unreinen: Geister brüten.\\
+tocopherol
+Vitamin E" " any or all of a group of closely related fat-soluble compounds
+that occur especially in plant oils and are anti-oxidants essential in the
+diets of many animals and probably of man. ")))
+(Assert
+ (equal
+  (split-string-by-char
+   #r"re\:ee:this\\is\\text\\\\:oo\ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzufluß versiegt oder abgeleitet wird. Aus dem Wasser,
+worüber der Geist Gottes schwebte, wird Sumpf und Moder, worüber die
+unreinen\: Geister brüten.\\
+tocopherol
+Vitamin E: any or all of a group of closely related fat-soluble compounds
+that occur especially in plant oils and are anti-oxidants essential in the
+diets of many animals and probably of man. "
+   ?: ?\x00)
+  '("re\\" "ee" "this\\\\is\\\\text\\\\\\\\" "oo\\ps" "
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzufluß versiegt oder abgeleitet wird. Aus dem Wasser,
+worüber der Geist Gottes schwebte, wird Sumpf und Moder, worüber die
+unreinen\\" " Geister brüten.\\\\
+tocopherol
+Vitamin E" " any or all of a group of closely related fat-soluble compounds
+that occur especially in plant oils and are anti-oxidants essential in the
+diets of many animals and probably of man. ")))
+(Assert
+ (equal
+  (split-string-by-char
+   #r"re\:ee:this\\is\\text\\\\:oo\ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzufluß versiegt oder abgeleitet wird. Aus dem Wasser,
+worüber der Geist Gottes schwebte, wird Sumpf und Moder, worüber die
+unreinen\: Geister brüten.\\
+tocopherol
+Vitamin E: any or all of a group of closely related fat-soluble compounds
+that occur especially in plant oils and are anti-oxidants essential in the
+diets of many animals and probably of man. " ?\\)
+  '("re" ":ee:this" "" "is" "" "text" "" "" "" ":oo" "ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzufluß versiegt oder abgeleitet wird. Aus dem Wasser,
+worüber der Geist Gottes schwebte, wird Sumpf und Moder, worüber die
+unreinen" ": Geister brüten." "" "
+tocopherol
+Vitamin E: any or all of a group of closely related fat-soluble compounds
+that occur especially in plant oils and are anti-oxidants essential in the
+diets of many animals and probably of man. ")))
+
+;;-----------------------------------------------------
 ;; Test near-text buffer functions.
 ;;-----------------------------------------------------
 (with-temp-buffer