summaryrefslogtreecommitdiff
path: root/core/source/test/scala
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2012-10-15 16:24:41 -0600
committerRocky Madden <git@rockymadden.com>2012-10-15 16:24:41 -0600
commit2085318fcd0f785630c3f2baad09f0d70b481cc6 (patch)
treea40a554397ea674d659d202d7188fa84c907630e /core/source/test/scala
parent488de0cd595a7a034d706f319ec7cdcacea6eaab (diff)
downloadstringmetric-2085318fcd0f785630c3f2baad09f0d70b481cc6.tar.gz
stringmetric-2085318fcd0f785630c3f2baad09f0d70b481cc6.tar.bz2
stringmetric-2085318fcd0f785630c3f2baad09f0d70b481cc6.zip
Created SoundexMetric, spec, and command.
Diffstat (limited to 'core/source/test/scala')
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/SoundexMetricSpec.scala35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/source/test/scala/org/hashtree/stringmetric/SoundexMetricSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/SoundexMetricSpec.scala
new file mode 100755
index 0000000..c688f9d
--- /dev/null
+++ b/core/source/test/scala/org/hashtree/stringmetric/SoundexMetricSpec.scala
@@ -0,0 +1,35 @@
+package org.hashtree.stringmetric
+
+import org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+@RunWith(classOf[JUnitRunner])
+final class SoundexMetricSpec extends ScalaTest {
+ "SoundexMetric" should provide {
+ "compare method" when passed {
+ "valid arguments" should returns {
+ "Boolean indicating matches" in {
+ SoundexMetric.compare("abc", "abc") should be (true) // a120 vs. a120
+ SoundexMetric.compare("a", "a") should be (true) // a000 vs. a000
+ SoundexMetric.compare("abc", "xyz") should be (false) // a120 vs. x200
+ SoundexMetric.compare("", "") should be (false)
+ SoundexMetric.compare("123", "123") should be (false)
+ SoundexMetric.compare("1", "1") should be (false)
+
+ SoundexMetric.compare("Robert", "Rupert") should be (true) // r163 vs. r163
+ SoundexMetric.compare("Robert", "Rubin") should be (false) // r163 vs. r150
+
+ SoundexMetric.compare("Ashcraft", "Ashcroft") should be (true) // a261 vs. a261
+ SoundexMetric.compare("Tymczak", "Tymczak") should be (true) // t522 vs. t522
+ SoundexMetric.compare("Pfister", "Pfister") should be (true) // p236 vs. p236
+ SoundexMetric.compare("Euler", "Ellery") should be (true) // e460 vs. e460
+ SoundexMetric.compare("Gauss", "Ghosh") should be (true) // g200 vs. g200
+ SoundexMetric.compare("Hilbert", "Heilbronn") should be (true) // h416 vs. h416
+ SoundexMetric.compare("Knuth", "Kant") should be (true) // k530 vs. k530
+ SoundexMetric.compare("Lloyd", "Ladd") should be (true) // l300 vs. l300
+ SoundexMetric.compare("Lukasiewicz", "Lissajous") should be (true) // l222 vs. l222
+ }
+ }
+ }
+ }
+} \ No newline at end of file