summaryrefslogtreecommitdiff
path: root/core/source/test/scala
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2012-11-28 09:11:27 -0700
committerRocky Madden <git@rockymadden.com>2012-11-28 09:11:27 -0700
commitd4a54178a055a03732d7b90d5a034184868f4b29 (patch)
treeba64ba7f53420e452a17cf900f038b1464f95cee /core/source/test/scala
parent8f970fe8befeb0895e21aac6fe6ef0e974f4d965 (diff)
downloadstringmetric-d4a54178a055a03732d7b90d5a034184868f4b29.tar.gz
stringmetric-d4a54178a055a03732d7b90d5a034184868f4b29.tar.bz2
stringmetric-d4a54178a055a03732d7b90d5a034184868f4b29.zip
Added more filter unit tests.
Diffstat (limited to 'core/source/test/scala')
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlOnlyStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberOnlyStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterOnlyStringFilterSpec.scala2
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberOnlyStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolOnlyStringFilterSpec.scala4
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolStringFilterSpec.scala2
-rwxr-xr-xcore/source/test/scala/org/hashtree/stringmetric/filter/StringFilterDelegateSpec.scala2
10 files changed, 34 insertions, 0 deletions
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlOnlyStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlOnlyStringFilterSpec.scala
index aca6af4..3272a64 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlOnlyStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlOnlyStringFilterSpec.scala
@@ -13,11 +13,15 @@ final class AsciiControlOnlyStringFilterSpec extends ScalaTest {
"String with mixed characters" should returns {
"String with non-controls removed" in {
Filter.filter("!@#$% ^&*()abc") should equal (" ")
+ Filter.filter(" ^&*()abc") should equal (" ")
+ Filter.filter("%^&*()abc ") should equal (" ")
}
}
"character array with mixed characters" should returns {
"character array with non-controls removed" in {
Filter.filter("!@#$% ^&*()abc".toCharArray) should equal (" ".toCharArray)
+ Filter.filter(" ^&*()abc") should equal (" ".toCharArray)
+ Filter.filter("%^&*()abc ") should equal (" ".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlStringFilterSpec.scala
index a315f95..d948366 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiControlStringFilterSpec.scala
@@ -13,11 +13,15 @@ final class AsciiControlStringFilterSpec extends ScalaTest {
"String with controls" should returns {
"String with controls removed" in {
Filter.filter(" HelloWorld") should equal ("HelloWorld")
+ Filter.filter("HelloWorld ") should equal ("HelloWorld")
+ Filter.filter("Hello World") should equal ("HelloWorld")
}
}
"character array with controls" should returns {
"character array with controls removed" in {
Filter.filter(" HelloWorld".toCharArray) should equal ("HelloWorld".toCharArray)
+ Filter.filter("HelloWorld ".toCharArray) should equal ("HelloWorld".toCharArray)
+ Filter.filter("Hello World".toCharArray) should equal ("HelloWorld".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberOnlyStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberOnlyStringFilterSpec.scala
index ac30fb5..5b1a72e 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberOnlyStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberOnlyStringFilterSpec.scala
@@ -14,12 +14,16 @@ final class AsciiLetterNumberOnlyStringFilterSpec extends ScalaTest {
"String with non-letters and non-numbers removed" in {
Filter.filter("!@#$%^&*()abc") should equal ("abc")
Filter.filter("!@#$%^&*()abc123") should equal ("abc123")
+ Filter.filter("abc123!@#$%^&*()") should equal ("abc123")
+ Filter.filter("!@#$%abc123^&*()") should equal ("abc123")
}
}
"character array with mixed characters" should returns {
"character array with non-letters and non-numbers removed" in {
Filter.filter("!@#$%^&*()abc".toCharArray) should equal ("abc".toCharArray)
Filter.filter("!@#$%^&*()abc123".toCharArray) should equal ("abc123".toCharArray)
+ Filter.filter("abc123!@#$%^&*()".toCharArray) should equal ("abc123".toCharArray)
+ Filter.filter("!@#$%abc123^&*()".toCharArray) should equal ("abc123".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberStringFilterSpec.scala
index d4f2729..bd24baf 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterNumberStringFilterSpec.scala
@@ -13,11 +13,15 @@ final class AsciiLetterNumberStringFilterSpec extends ScalaTest {
"String with letters and numbers" should returns {
"String with letters and numbers removed" in {
Filter.filter(" Hello123World!") should equal (" !")
+ Filter.filter("Hello123 !World") should equal (" !")
+ Filter.filter("!Hello123World ") should equal ("! ")
}
}
"character array with letters and numbers" should returns {
"character array with letters and numbers removed" in {
Filter.filter(" Hello123World!".toCharArray) should equal (" !".toCharArray)
+ Filter.filter("Hello123 !World".toCharArray) should equal (" !".toCharArray)
+ Filter.filter("!Hello123World ".toCharArray) should equal ("! ".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterOnlyStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterOnlyStringFilterSpec.scala
index b6d4054..7b2e655 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterOnlyStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiLetterOnlyStringFilterSpec.scala
@@ -14,12 +14,14 @@ final class AsciiLetterOnlyStringFilterSpec extends ScalaTest {
"String with non-letters removed" in {
Filter.filter("!@#$%^&*()abc") should equal ("abc")
Filter.filter("!@#$%^&*()abc123") should equal ("abc")
+ Filter.filter("abc!@#$%^&*()123") should equal ("abc")
}
}
"character array with mixed characters" should returns {
"character array with non-letters removed" in {
Filter.filter("!@#$%^&*()abc".toCharArray) should equal ("abc".toCharArray)
Filter.filter("!@#$%^&*()abc123".toCharArray) should equal ("abc".toCharArray)
+ Filter.filter("abc!@#$%^&*()123".toCharArray) should equal ("abc".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberOnlyStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberOnlyStringFilterSpec.scala
index e3daa9d..f6ac54d 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberOnlyStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberOnlyStringFilterSpec.scala
@@ -13,11 +13,15 @@ final class AsciiNumberOnlyStringFilterSpec extends ScalaTest {
"String with mixed characters" should returns {
"String with non-numbers removed" in {
Filter.filter("!@#$%^&*()abc123") should equal ("123")
+ Filter.filter("123!@#$%^&*()abc") should equal ("123")
+ Filter.filter("!@#$%^123&*()abc") should equal ("123")
}
}
"character array with mixed characters" should returns {
"character array with non-numbers removed" in {
Filter.filter("!@#$%^&*()abc123".toCharArray) should equal ("123".toCharArray)
+ Filter.filter("123!@#$%^&*()abc".toCharArray) should equal ("123".toCharArray)
+ Filter.filter("!@#$%^123&*()abc".toCharArray) should equal ("123".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberStringFilterSpec.scala
index ccb1761..79de3bf 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiNumberStringFilterSpec.scala
@@ -13,11 +13,15 @@ final class AsciiNumberStringFilterSpec extends ScalaTest {
"String with numbers" should returns {
"String with numbers removed" in {
Filter.filter(" Hello123World!") should equal (" HelloWorld!")
+ Filter.filter("123 HelloWorld!") should equal (" HelloWorld!")
+ Filter.filter(" HelloWorld!123") should equal (" HelloWorld!")
}
}
"character array with numbers" should returns {
"character array with numbers removed" in {
Filter.filter(" Hello123World!".toCharArray) should equal (" HelloWorld!".toCharArray)
+ Filter.filter("123 HelloWorld!".toCharArray) should equal (" HelloWorld!".toCharArray)
+ Filter.filter(" HelloWorld!123".toCharArray) should equal (" HelloWorld!".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolOnlyStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolOnlyStringFilterSpec.scala
index e4010ca..e994ae5 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolOnlyStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolOnlyStringFilterSpec.scala
@@ -13,11 +13,15 @@ final class AsciiSymbolOnlyStringFilterSpec extends ScalaTest {
"String with mixed characters" should returns {
"String with non-symbols removed" in {
Filter.filter("!@#$%^&*()abc123") should equal ("!@#$%^&*()")
+ Filter.filter("abc123!@#$%^&*()") should equal ("!@#$%^&*()")
+ Filter.filter("!@#$%abc123^&*()") should equal ("!@#$%^&*()")
}
}
"character array with mixed characters" should returns {
"character array with non-symbols removed" in {
Filter.filter("!@#$%^&*()abc123".toCharArray) should equal ("!@#$%^&*()".toCharArray)
+ Filter.filter("abc123!@#$%^&*()".toCharArray) should equal ("!@#$%^&*()".toCharArray)
+ Filter.filter("!@#$%abc123^&*()".toCharArray) should equal ("!@#$%^&*()".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolStringFilterSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolStringFilterSpec.scala
index b7d196b..4c867c5 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolStringFilterSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolStringFilterSpec.scala
@@ -13,11 +13,13 @@ final class AsciiSymbolStringFilterSpec extends ScalaTest {
"String with symbols" should returns {
"String with symbols removed" in {
Filter.filter("[HelloWorld]") should equal ("HelloWorld")
+ Filter.filter("Hello!World") should equal ("HelloWorld")
}
}
"character array with symbols" should returns {
"character array with symbols removed" in {
Filter.filter("[HelloWorld]".toCharArray) should equal ("HelloWorld".toCharArray)
+ Filter.filter("Hello!World".toCharArray) should equal ("HelloWorld".toCharArray)
}
}
}
diff --git a/core/source/test/scala/org/hashtree/stringmetric/filter/StringFilterDelegateSpec.scala b/core/source/test/scala/org/hashtree/stringmetric/filter/StringFilterDelegateSpec.scala
index fc1dd5f..5e5cc7f 100755
--- a/core/source/test/scala/org/hashtree/stringmetric/filter/StringFilterDelegateSpec.scala
+++ b/core/source/test/scala/org/hashtree/stringmetric/filter/StringFilterDelegateSpec.scala
@@ -13,11 +13,13 @@ final class StringFilterDelegateSpec extends ScalaTest {
"String" should returns {
"the same String" in {
Filter.filter("Hello World") should equal ("Hello World")
+ Filter.filter(" Hello! World]") should equal (" Hello! World]")
}
}
"character array" should returns {
"the same character array" in {
Filter.filter("Hello World".toCharArray) should equal ("Hello World".toCharArray)
+ Filter.filter(" Hello! World]".toCharArray) should equal (" Hello! World]".toCharArray)
}
}
}