cvs: pear /Text_LanguageDetect/tests unittest.php

From: Date: Thu, 19 Jan 2006 04:13:28 +0000
Subject: cvs: pear /Text_LanguageDetect/tests unittest.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-37648@lists.php.net to get a copy of this message
taak Thu Jan 19 04:13:28 2006 UTC Modified files: /pear/Text_LanguageDetect/tests unittest.php Log: added test for new unicode narrowing accessor function http://cvs.php.net/viewcvs.cgi/pear/Text_LanguageDetect/tests/unittest.php?r1=1.7&r2=1.8&diff_format=u Index: pear/Text_LanguageDetect/tests/unittest.php diff -u pear/Text_LanguageDetect/tests/unittest.php:1.7 pear/Text_LanguageDetect/tests/unittest.php:1.8 --- pear/Text_LanguageDetect/tests/unittest.php:1.7 Tue Jan 17 18:58:09 2006 +++ pear/Text_LanguageDetect/tests/unittest.php Thu Jan 19 04:13:28 2006 @@ -2,7 +2,7 @@ /** * @package Text_LanguageDetect - * @version CVS: $Id: unittest.php,v 1.7 2006/01/17 18:58:09 taak Exp $ + * @version CVS: $Id: unittest.php,v 1.8 2006/01/19 04:13:28 taak Exp $ */ require_once '../Text/LanguageDetect.php'; @@ -1596,6 +1596,27 @@ } } + function test_unicode_off() + { + + // see what happens when you turn the unicode setting off + + $myobj = new Text_LanguageDetect; + + $str = 'This is a delightful sample of English text'; + + $myobj->useUnicodeBlocks(true); + $result1 = $myobj->detectConfidence($str); + + $myobj->useUnicodeBlocks(false); + $result2 = $myobj->detectConfidence($str); + + $this->assertEquals($result1, $result2); + + // note this test doesn't tell if unicode narrowing was actually used or not + } + + function test_detection() {

« previous php.pear.cvs (#37648) next »