summaryrefslogtreecommitdiff
path: root/_test/cases/inc/utf8_romanize.test.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-05-06 22:37:07 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-05-06 22:37:07 +0200
commit9476a253b9cef65ab9f56f3c4938cde99d9cf11b (patch)
tree80b605b7becde16202ba38621e36b85d834133c5 /_test/cases/inc/utf8_romanize.test.php
parent703839065b81b944eb80e10dec5be4d1752ca9ee (diff)
downloadrpg-9476a253b9cef65ab9f56f3c4938cde99d9cf11b.tar.gz
rpg-9476a253b9cef65ab9f56f3c4938cde99d9cf11b.tar.bz2
Updates for Japanese romanization support FS#1363
This patch adds some fixes for the romanization lookup table and a test case for more than 20000 phrases and their correct romanization. About 2100 tests currently fail. darcs-hash:20080506203707-7ad00-9d95b8af459fa44c8d3e95560c7e1c116b8ffc48.gz
Diffstat (limited to '_test/cases/inc/utf8_romanize.test.php')
-rw-r--r--_test/cases/inc/utf8_romanize.test.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/_test/cases/inc/utf8_romanize.test.php b/_test/cases/inc/utf8_romanize.test.php
new file mode 100644
index 000000000..e1c1be7c2
--- /dev/null
+++ b/_test/cases/inc/utf8_romanize.test.php
@@ -0,0 +1,24 @@
+<?php
+// use no mbstring help here
+if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
+require_once DOKU_INC.'inc/utf8.php';
+
+class utf8_substr_test extends UnitTestCase {
+
+ /**
+ * Check Japanese romanization
+ *
+ * @author Denis Scheither <amorphis@uni-bremen.de>
+ */
+ function test_japanese(){
+ $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt');
+ foreach($tests as $test){
+ list($jap,$rom) = explode(';',trim($test));
+
+ $chk = utf8_romanize($jap);
+ #if($chk != $rom) echo "$jap\t->\t$chk\t!=\t$rom\n";
+ $this->assertEqual($chk,$rom);
+ }
+ }
+}
+//Setup VIM: ex: et ts=4 enc=utf-8 :