[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 0c2056c 209/350: Basic tests for EBDB's internatio
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 0c2056c 209/350: Basic tests for EBDB's internationalization support |
Date: |
Mon, 14 Aug 2017 11:46:38 -0400 (EDT) |
branch: externals/ebdb
commit 0c2056c1847ea7041e569a298e64c056112828cf
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Basic tests for EBDB's internationalization support
* ebdb-i18n-test.el: Not much in here, but it's a start.
---
ebdb-i18n-test.el | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/ebdb-i18n-test.el b/ebdb-i18n-test.el
new file mode 100644
index 0000000..f4372c9
--- /dev/null
+++ b/ebdb-i18n-test.el
@@ -0,0 +1,59 @@
+;;; ebdb-i18n-test.el --- Tests for EBDB's internationalization support -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Eric Abrahamsen <address@hidden>
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file obviously depends on ebdb-i18n and all region-specific
+;; files that come with EBDB, and if you run the tests in an
+;; interactive session it will load those files. If you had EBDB
+;; running as a normal user, loading these tests might change EBDB's
+;; behavior.
+
+;;; Code:
+
+(require 'ert)
+(require 'ebdb-i18n)
+(require 'ebdb-chn)
+
+;; Basic name parsing.
+
+;; Regular latin names shouldn't be parsed any differently with the
+;; i18n files loaded.
+
+(ert-deftest ebdb-i18n-parse-name ()
+ (let ((max (ebdb-parse 'ebdb-field-name-complex "Max von Sydow"))
+ (brigitte (ebdb-parse 'ebdb-field-name-complex "Brigitte Bardot")))
+ (should (string= (ebdb-name-last max) "von Sydow"))
+ (should (string= (ebdb-name-last brigitte) "Bardot"))))
+
+(ert-deftest ebdb-i18n-parse-chinese-name ()
+ "Parse names in Chinese.
+
+Uses `ebdb-parse-i18n' method from ebdb-chn.el."
+ (let ((two-char (ebdb-parse 'ebdb-field-name-complex "李四"))
+ (three-char (ebdb-parse 'ebdb-field-name-complex "张国荣"))
+ (compound-surname-1 (ebdb-parse 'ebdb-field-name-complex "司马迁"))
+ (compound-surname-2 (ebdb-parse 'ebdb-field-name-complex "慕容学村")))
+ (should (string= (ebdb-name-last two-char) "李"))
+ (should (string= (ebdb-name-last three-char) "张"))
+ (should (string= (ebdb-name-last compound-surname-1) "司马"))
+ (should (string= (ebdb-name-last compound-surname-2) "慕容"))))
+
+(provide 'ebdb-i18n-test)
+;;; ebdb-i18n-test.el ends here
- [elpa] externals/ebdb 06123d9 217/350: Make sure database files are decoded as utf-8-emacs, (continued)
- [elpa] externals/ebdb 06123d9 217/350: Make sure database files are decoded as utf-8-emacs, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c07babf 203/350: If alt-names search fails, fall back on actual name field search, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 501edfb 149/350: Give Org mode its own popup window, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0612d92 153/350: Comment out ebdb-mua-auto-snarf-signature, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 957fc1b 157/350: Implement popping of buffer search history, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3cb827e 181/350: Check for existence of fiel-attribute-modification-time, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aabe2c0 189/350: Stupid mistake in previous commit, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6549647 198/350: More tests, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f316417 202/350: Change keybinding for ebdb-prev-field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bfc5d9d 208/350: Internationalized ebdb-parse method for names must accept slots arg, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0c2056c 209/350: Basic tests for EBDB's internationalization support,
Eric Abrahamsen <=
- [elpa] externals/ebdb 2bfb04e 220/350: Move ebdb-message-search to ebdb.el, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 40d71b9 222/350: Steal UUID generating function from Org, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4937cbd 225/350: Specify class of name fields when updating from MUA, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 13c0a38 216/350: Tweaks to testing macros, more tests, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2b28f57 239/350: Bump to version 0.2, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ff3cfa4 232/350: ebdb-parse-i18n for Chinese phones should pass class arg through, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d5bec83 229/350: Fix to UUID change, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 72aba6a 228/350: New label/field alist for vcard export, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d0d0bbb 233/350: Shift transformation of search strings into ebdb-search, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dc4217d 213/350: Compiler-inspired fixes, volume 5453, Eric Abrahamsen, 2017/08/14