diff options
author | andy wharmby <wharmby@php.net> | 2009-08-17 10:37:30 +0000 |
---|---|---|
committer | andy wharmby <wharmby@php.net> | 2009-08-17 10:37:30 +0000 |
commit | db6a41487d386562a81e3f822993105adf2df18c (patch) | |
tree | 3bb8b49a147db0f38d4e011b0473ed80deed0bd1 /ext/standard/tests/strings/soundex_basic.phpt | |
parent | 8f523cb33b623fbf2f629df9cf95363711a08170 (diff) | |
download | php-git-db6a41487d386562a81e3f822993105adf2df18c.tar.gz |
New basic string tests - includes back-porting a few existing tests back to 5.2. All tested on Windows, Linux and Linux 64
Diffstat (limited to 'ext/standard/tests/strings/soundex_basic.phpt')
-rw-r--r-- | ext/standard/tests/strings/soundex_basic.phpt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/soundex_basic.phpt b/ext/standard/tests/strings/soundex_basic.phpt new file mode 100644 index 0000000000..65bcb64252 --- /dev/null +++ b/ext/standard/tests/strings/soundex_basic.phpt @@ -0,0 +1,46 @@ +--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype : string soundex ( string $str )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing soundex() : basic functionality ***\n";
+
+var_dump(soundex("Euler"));
+var_dump(soundex("Gauss"));
+var_dump(soundex("Hilbert"));
+var_dump(soundex("Knuth"));
+var_dump(soundex("Lloyd"));
+var_dump(soundex("Lukasiewicz"));
+
+var_dump(soundex("Euler") == soundex("Ellery")); // E460
+var_dump(soundex("Gauss") == soundex("Ghosh")); // G200
+var_dump(soundex("Hilbert") == soundex("Heilbronn")); // H416
+var_dump(soundex("Knuth") == soundex("Kant")); // K530
+var_dump(soundex("Lloyd") == soundex("Ladd")); // L300
+var_dump(soundex("Lukasiewicz") == soundex("Lissajous")); // L222
+
+var_dump(soundex("Lukasiewicz") == soundex("Ghosh"));
+var_dump(soundex("Hilbert") == soundex("Ladd"));
+?>
+===DONE===
+--EXPECT--
+*** Testing soundex() : basic functionality ***
+string(4) "E460"
+string(4) "G200"
+string(4) "H416"
+string(4) "K530"
+string(4) "L300"
+string(4) "L222"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+
+===DONE===
|