diff options
author | Rocky Madden <git@rockymadden.com> | 2014-03-26 16:09:24 -0600 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2014-03-26 16:09:24 -0600 |
commit | 3c806b88e9169ed742ae5740d81fbbb24f0ca768 (patch) | |
tree | 4b6a75a1042000841200b6af031abe62b542ab71 /core/src/test/scala/com/rockymadden/stringmetric/transformSpec.scala | |
parent | a25d9e70528a0b2bab96cc55ede9232076fd4299 (diff) | |
download | stringmetric-3c806b88e9169ed742ae5740d81fbbb24f0ca768.tar.gz stringmetric-3c806b88e9169ed742ae5740d81fbbb24f0ca768.tar.bz2 stringmetric-3c806b88e9169ed742ae5740d81fbbb24f0ca768.zip |
Removed module structure.
Diffstat (limited to 'core/src/test/scala/com/rockymadden/stringmetric/transformSpec.scala')
-rw-r--r-- | core/src/test/scala/com/rockymadden/stringmetric/transformSpec.scala | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/core/src/test/scala/com/rockymadden/stringmetric/transformSpec.scala b/core/src/test/scala/com/rockymadden/stringmetric/transformSpec.scala new file mode 100644 index 0000000..01fa3a3 --- /dev/null +++ b/core/src/test/scala/com/rockymadden/stringmetric/transformSpec.scala @@ -0,0 +1,159 @@ +package com.rockymadden.stringmetric + +import com.rockymadden.stringmetric.transform._ + +object transformSpec extends org.specs2.mutable.SpecificationWithJUnit { + "filterAlpha()" should { + "return transformed" in { + filterAlpha( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo("aBc".toCharArray) + } + } + + "filterNotAlpha()" should { + "return transformed" in { + filterNotAlpha( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("123" + 0x250.toChar).toCharArray + ) + } + } + + "filterAlphaNumeric()" should { + "return transformed" in { + filterAlphaNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo("aBc123".toCharArray) + } + } + + "filterNotAlphaNumeric()" should { + "return transformed" in { + filterNotAlphaNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("" + 0x250.toChar).toCharArray + ) + } + } + + "filterAscii()" should { + "return transformed" in { + filterAscii( + ("aBc" + 0x80.toChar).toCharArray + ) must beEqualTo("aBc".toCharArray) + } + } + + "filterNotAscii()" should { + "return transformed" in { + filterNotAscii( + ("aBc" + 0x100.toChar).toCharArray + ) must beEqualTo( + ("" + 0x100.toChar).toCharArray + ) + } + } + + "filterExtendedAscii()" should { + "return transformed" in { + filterExtendedAscii( + ("aBc" + 0x100.toChar).toCharArray + ) must beEqualTo("aBc".toCharArray) + } + } + + "filterNotExtendedAscii()" should { + "return transformed" in { + filterNotExtendedAscii( + ("aBc" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("" + 0x250.toChar).toCharArray + ) + } + } + + "filterLatin()" should { + "return transformed" in { + filterLatin( + ("aBc" + 0x250.toChar).toCharArray + ) must beEqualTo("aBc".toCharArray) + } + } + + "filterNotLatin()" should { + "return transformed" in { + filterNotLatin( + ("aBc" + 0x300.toChar).toCharArray + ) must beEqualTo( + ("" + 0x300.toChar).toCharArray + ) + } + } + + "filterLowerCase()" should { + "return transformed" in { + filterLowerCase( + "aBc123" + 0x250.toChar + ) must beEqualTo("ac".toCharArray) + } + } + + "filterNotLowerCase()" should { + "return transformed" in { + filterNotLowerCase( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("B123" + 0x250.toChar).toCharArray + ) + } + } + + "filterNumeric()" should { + "return transformed" in { + filterNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo("123".toCharArray) + } + } + + "filterNotNumeric()" should { + "return transformed" in { + filterNotNumeric( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("aBc" + 0x250.toChar).toCharArray + ) + } + } + + "filterUpperCase()" should { + "return transformed" in { + filterUpperCase( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo("B".toCharArray) + } + } + + "filterNotUpperCase()" should { + "return transformed" in { + filterNotUpperCase( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("ac123" + 0x250.toChar).toCharArray + ) + } + } + + "ignoreAlphaCase()" should { + "return transformed" in { + ignoreAlphaCase( + ("aBc123" + 0x250.toChar).toCharArray + ) must beEqualTo( + ("abc123" + 0x250.toChar).toCharArray + ) + } + } +} |