diff options
author | Rocky Madden <git@rockymadden.com> | 2013-12-29 15:22:19 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-12-29 15:22:19 -0700 |
commit | 3c7fa80a8561c4cbecba6122b5989cb600556ec8 (patch) | |
tree | e9d84d0506eb672bd779b64aa77eb3cca0d2ff6f /core/source | |
parent | 84863d35f7e04bd54818d8efeba1f1d67b3097a4 (diff) | |
download | stringmetric-3c7fa80a8561c4cbecba6122b5989cb600556ec8.tar.gz stringmetric-3c7fa80a8561c4cbecba6122b5989cb600556ec8.tar.bz2 stringmetric-3c7fa80a8561c4cbecba6122b5989cb600556ec8.zip |
Fixed broken unit tests.
Diffstat (limited to 'core/source')
-rw-r--r-- | core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala | 80 |
1 files changed, 64 insertions, 16 deletions
diff --git a/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala index b038f1b..5b93cfa 100644 --- a/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala +++ b/core/source/test/scala/com/rockymadden/stringmetric/TransformSpec.scala @@ -10,112 +10,160 @@ final class TransformSpec extends ScalaTest { "StringTransform" should provide { "filterAlpha()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterAlpha("aBc123" + 0x250.toChar) should be ("aBc") + StringTransform.filterAlpha( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ("aBc".toCharArray) } } } "filterNotAlpha()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotAlpha("aBc123" + 0x250.toChar) should be ("123" + 0x250.toChar) + StringTransform.filterNotAlpha( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ( + ("123" + 0x250.toChar).toCharArray + ) } } } "filterAlphaNumeric()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterAlphaNumeric("aBc123" + 0x250.toChar) should be ("aBc123") + StringTransform.filterAlphaNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ("aBc123".toCharArray) } } } "filterNotAlphaNumeric()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotAlphaNumeric("aBc123" + 0x250.toChar) should be ("" + 0x250.toChar) + StringTransform.filterNotAlphaNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ( + ("" + 0x250.toChar).toCharArray + ) } } } "filterAscii()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterAscii("aBc" + 0x80.toChar) should be ("aBc") + StringTransform.filterAscii( + ("aBc" + 0x80.toChar).toCharArray + ) should equal ("aBc".toCharArray) } } } "filterNotAscii()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotAscii("aBc" + 0x100.toChar) should be ("" + 0x100.toChar) + StringTransform.filterNotAscii( + ("aBc" + 0x100.toChar).toCharArray + ) should equal ( + ("" + 0x100.toChar).toCharArray + ) } } } "filterExtendedAscii()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterExtendedAscii("aBc" + 0x100.toChar) should be ("aBc") + StringTransform.filterExtendedAscii( + ("aBc" + 0x100.toChar).toCharArray + ) should equal ("aBc".toCharArray) } } } "filterNotExtendedAscii()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotExtendedAscii("aBc" + 0x250.toChar) should be ("" + 0x250.toChar) + StringTransform.filterNotExtendedAscii( + ("aBc" + 0x250.toChar).toCharArray + ) should equal ( + ("" + 0x250.toChar).toCharArray + ) } } } "filterLatin()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterLatin("aBc" + 0x250.toChar) should be ("aBc") + StringTransform.filterLatin( + ("aBc" + 0x250.toChar).toCharArray + ) should equal ("aBc".toCharArray) } } } "filterNotLatin()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotLatin("aBc" + 0x300.toChar) should be ("" + 0x300.toChar) + StringTransform.filterNotLatin( + ("aBc" + 0x300.toChar).toCharArray + ) should equal ( + ("" + 0x300.toChar).toCharArray + ) } } } "filterLowerCase()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterLowerCase("aBc123" + 0x250.toChar) should be ("ac") + StringTransform.filterLowerCase( + "aBc123" + 0x250.toChar + ) should equal ("ac".toCharArray) } } } "filterNotLowerCase()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotLowerCase("aBc123" + 0x250.toChar) should be ("B123" + 0x250.toChar) + StringTransform.filterNotLowerCase( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ( + ("B123" + 0x250.toChar).toCharArray + ) } } } "filterNumeric()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNumeric("aBc123" + 0x250.toChar) should be ("123") + StringTransform.filterNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ("123".toCharArray) } } } "filterNotNumeric()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotNumeric("aBc123" + 0x250.toChar) should be ("aBc" + 0x250.toChar) + StringTransform.filterNotNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ( + ("aBc" + 0x250.toChar).toCharArray + ) } } } "filterUpperCase()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterUpperCase("aBc123" + 0x250.toChar) should be ("B") + StringTransform.filterUpperCase( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ("B".toCharArray) } } } "filterNotUpperCase()" when passed { "String" should returns { "transformed String" in { - StringTransform.filterNotUpperCase("aBc123" + 0x250.toChar) should be ("ac123" + 0x250.toChar) + StringTransform.filterNotUpperCase( + ("aBc123" + 0x250.toChar).toCharArray + ) should equal ( + ("ac123" + 0x250.toChar).toCharArray + ) } } } |