summaryrefslogtreecommitdiff
path: root/_test/tests/inc/utf8_romanize.cputest.php
diff options
context:
space:
mode:
Diffstat (limited to '_test/tests/inc/utf8_romanize.cputest.php')
-rw-r--r--_test/tests/inc/utf8_romanize.cputest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/_test/tests/inc/utf8_romanize.cputest.php b/_test/tests/inc/utf8_romanize.cputest.php
new file mode 100644
index 000000000..66e3b76c9
--- /dev/null
+++ b/_test/tests/inc/utf8_romanize.cputest.php
@@ -0,0 +1,36 @@
+<?php
+// use no mbstring help here
+if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
+require_once DOKU_INC.'inc/utf8.php';
+
+class utf8_romanize_test extends PHPUnit_Framework_TestCase {
+
+ /**
+ * Check Japanese romanization
+ *
+ * @author Denis Scheither <amorphis@uni-bremen.de>
+ */
+ function test_japanese(){
+ $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt');
+ $line = 1;
+ 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\t($line)\n";
+ $this->assertEquals($chk,$rom);
+ $line++;
+ }
+ }
+
+ /**
+ * Test romanization of character that would usually be deaccented in a different
+ * way FS#1117
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function test_deaccented(){
+ $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö"));
+ }
+}
+//Setup VIM: ex: et ts=4 :