Re: Re: similar_text() testcase
| From: | zoe | Date: | Sat, 26 Apr 2008 14:24:25 +0000 |
| Subject: | Re: Re: similar_text() testcase | ||
| References: | 1 2 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64227@lists.php.net to get a copy of this message | ||
Hey thanks! It looks good at a quick glance, I'll do a couple of checks before committing. Are you doing this as part of TestFest activity?
Zoe
Slight note -- I got the snaps for php6, and 5.2 as well, and the source for 4.4.8 , and it passed on all 3 of those as well. Vilerage wrote:Hi, this is my first attempt at writing a testcase, an autogenerated one for similar_text. It's fairly straightforward, and I've tested it against the only setup I have available -- PHP 5.3 (got it from snaps -- 200804260630 )running on Debian Linux (2.6.24 -- AMD64 SMP) Anyhow, here goes: --TEST-- Test similar_text() function : basic functionality --FILE-- <?php /* Prototype : int similar_text(string str1, string str2 [, float percent]) * Description: Calculates the similarity between two strings * Source code: ext/standard/string.c * Alias to functions: */ echo "*** Testing similar_text() : basic functionality ***\n"; // Initialise all required variables $str1 = 'Foobar123'; $str2 = 'fooBar456'; // Calling similar_text() with all possible arguments var_dump( similar_text($str1, $str2, $percent) ); var_dump( $percent ); // Calling similar_text() with mandatory arguments var_dump( similar_text($str1, $str2) ); ?> ===DONE=== --EXPECTF-- *** Testing similar_text() : basic functionality *** int(4) float(44.444444444444) int(4) ===DONE===