jmessa          Mon Jul 14 15:28:51 2008 UTC

  Modified files:              
    /php-src/ext/standard/tests/strings similar_text_basic.phpt 
                                        similar_text_error.phpt 
  Log:
  - Tests from TestFest
  - Have slightly modified similar_text_error.phpt from original file
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/similar_text_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/similar_text_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/similar_text_basic.phpt:1.2
--- /dev/null   Mon Jul 14 15:28:51 2008
+++ php-src/ext/standard/tests/strings/similar_text_basic.phpt  Mon Jul 14 
15:28:51 2008
@@ -0,0 +1,39 @@
+--TEST--
+similar_text(), basic tests
+--CREDITS--
+Mats Lindh <mats at lindh.no>
+#Testfest php.no
+--INIT--
+precision=14
+--FILE--
+<?php
+/* Prototype  : proto int similar_text(string str1, string str2 [, float 
percent])
+* Description: Calculates the similarity between two strings
+* Source code: ext/standard/string.c
+*/
+var_dump(similar_text("abcdefgh", "efg"));
+var_dump(similar_text("abcdefgh", "mno"));
+var_dump(similar_text("abcdefghcc", "c"));
+var_dump(similar_text("abcdefghabcdef", "zzzzabcdefggg"));
+
+$percent = 0;
+similar_text("abcdefgh", "efg", $percent);
+var_dump($percent);
+similar_text("abcdefgh", "mno", $percent);
+var_dump($percent);
+similar_text("abcdefghcc", "c", $percent);
+var_dump($percent);
+similar_text("abcdefghabcdef", "zzzzabcdefggg", $percent);
+var_dump($percent);
+?>
+===DONE===
+--EXPECTF--
+int(3)
+int(0)
+int(1)
+int(7)
+float(54.545454545455)
+float(0)
+float(18.181818181818)
+float(51.851851851852)
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/similar_text_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/similar_text_error.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/similar_text_error.phpt:1.2
--- /dev/null   Mon Jul 14 15:28:51 2008
+++ php-src/ext/standard/tests/strings/similar_text_error.phpt  Mon Jul 14 
15:28:51 2008
@@ -0,0 +1,29 @@
+--TEST--
+similar_text(), error tests for missing parameters
+--CREDITS--
+Mats Lindh <mats at lindh.no>
+#Testfest php.no
+--FILE--
+<?php
+/* Prototype  : proto int similar_text(string str1, string str2 [, float 
percent])
+* Description: Calculates the similarity between two strings
+* Source code: ext/standard/string.c
+*/
+
+$extra_arg = 10;
+echo "\n-- Testing similar_text() function with more than expected no. of 
arguments --\n";
+similar_text("abc", "def", $percent, $extra_arg);
+
+echo "\n-- Testing similar_text() function with less than expected no. of 
arguments --\n";
+similar_text("abc");
+?>
+===DONE===
+--EXPECTF--
+-- Testing similar_text() function with more than expected no. of arguments --
+
+Warning: similar_text() expects at most 3 parameters, 4 given in %s on line %d
+
+-- Testing similar_text() function with less than expected no. of arguments --
+
+Warning: similar_text() expects at least 2 parameters, 1 given in %s on line %d
+===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to