comparison 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 (2010-02-07)
parents 1b96882bdf37
children 9624523604c5
comparison
equal deleted inserted replaced
5034:1b96882bdf37 5035:b1e48555be7d
1 ;; Copyright (C) 1998 Free Software Foundation, Inc. 1 ;; Copyright (C) 1998 Free Software Foundation, Inc. -*- coding: iso-8859-1 -*-
2 2
3 ;; Author: Martin Buchholz <martin@xemacs.org> 3 ;; Author: Martin Buchholz <martin@xemacs.org>
4 ;; Maintainer: Martin Buchholz <martin@xemacs.org> 4 ;; Maintainer: Martin Buchholz <martin@xemacs.org>
5 ;; Created: 1998 5 ;; Created: 1998
6 ;; Keywords: tests 6 ;; Keywords: tests
1073 '("foo" "bar")) 1073 '("foo" "bar"))
1074 (Assert-equal (split-string "foo bar " split-string-default-separators) 1074 (Assert-equal (split-string "foo bar " split-string-default-separators)
1075 '("foo" "bar" "")) 1075 '("foo" "bar" ""))
1076 (Assert-equal (split-string "foobar" split-string-default-separators) 1076 (Assert-equal (split-string "foobar" split-string-default-separators)
1077 '("foobar")) 1077 '("foobar"))
1078
1079 ;;-----------------------------------------------------
1080 ;; Test split-string-by-char
1081 ;;-----------------------------------------------------
1082
1083 (Assert
1084 (equal
1085 (split-string-by-char
1086 #r"re\:ee:this\\is\\text\\\\:oo\ps:
1087 Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
1088 bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
1089 wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
1090 unreinen\: Geister br�ten.\\
1091 tocopherol
1092 Vitamin E: any or all of a group of closely related fat-soluble compounds
1093 that occur especially in plant oils and are anti-oxidants essential in the
1094 diets of many animals and probably of man. "
1095 ?: ?\\)
1096 '("re:ee" "this\\is\\text\\\\" "oops" "
1097 Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
1098 bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
1099 wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
1100 unreinen: Geister br�ten.\\
1101 tocopherol
1102 Vitamin E" " any or all of a group of closely related fat-soluble compounds
1103 that occur especially in plant oils and are anti-oxidants essential in the
1104 diets of many animals and probably of man. ")))
1105 (Assert
1106 (equal
1107 (split-string-by-char
1108 #r"re\:ee:this\\is\\text\\\\:oo\ps:
1109 Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
1110 bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
1111 wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
1112 unreinen\: Geister br�ten.\\
1113 tocopherol
1114 Vitamin E: any or all of a group of closely related fat-soluble compounds
1115 that occur especially in plant oils and are anti-oxidants essential in the
1116 diets of many animals and probably of man. "
1117 ?: ?\x00)
1118 '("re\\" "ee" "this\\\\is\\\\text\\\\\\\\" "oo\\ps" "
1119 Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
1120 bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
1121 wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
1122 unreinen\\" " Geister br�ten.\\\\
1123 tocopherol
1124 Vitamin E" " any or all of a group of closely related fat-soluble compounds
1125 that occur especially in plant oils and are anti-oxidants essential in the
1126 diets of many animals and probably of man. ")))
1127 (Assert
1128 (equal
1129 (split-string-by-char
1130 #r"re\:ee:this\\is\\text\\\\:oo\ps:
1131 Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
1132 bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
1133 wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
1134 unreinen\: Geister br�ten.\\
1135 tocopherol
1136 Vitamin E: any or all of a group of closely related fat-soluble compounds
1137 that occur especially in plant oils and are anti-oxidants essential in the
1138 diets of many animals and probably of man. " ?\\)
1139 '("re" ":ee:this" "" "is" "" "text" "" "" "" ":oo" "ps:
1140 Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
1141 bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
1142 wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
1143 unreinen" ": Geister br�ten." "" "
1144 tocopherol
1145 Vitamin E: any or all of a group of closely related fat-soluble compounds
1146 that occur especially in plant oils and are anti-oxidants essential in the
1147 diets of many animals and probably of man. ")))
1078 1148
1079 ;;----------------------------------------------------- 1149 ;;-----------------------------------------------------
1080 ;; Test near-text buffer functions. 1150 ;; Test near-text buffer functions.
1081 ;;----------------------------------------------------- 1151 ;;-----------------------------------------------------
1082 (with-temp-buffer 1152 (with-temp-buffer