blob: b038f1b1d95523993c6eb23d3abcf416b1a0afc0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
package com.rockymadden.stringmetric
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
final class TransformSpec extends ScalaTest { "StringTransform" should provide {
import com.rockymadden.stringmetric.Transform._
"filterAlpha()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterAlpha("aBc123" + 0x250.toChar) should be ("aBc")
}
}
}
"filterNotAlpha()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotAlpha("aBc123" + 0x250.toChar) should be ("123" + 0x250.toChar)
}
}
}
"filterAlphaNumeric()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterAlphaNumeric("aBc123" + 0x250.toChar) should be ("aBc123")
}
}
}
"filterNotAlphaNumeric()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotAlphaNumeric("aBc123" + 0x250.toChar) should be ("" + 0x250.toChar)
}
}
}
"filterAscii()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterAscii("aBc" + 0x80.toChar) should be ("aBc")
}
}
}
"filterNotAscii()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotAscii("aBc" + 0x100.toChar) should be ("" + 0x100.toChar)
}
}
}
"filterExtendedAscii()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterExtendedAscii("aBc" + 0x100.toChar) should be ("aBc")
}
}
}
"filterNotExtendedAscii()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotExtendedAscii("aBc" + 0x250.toChar) should be ("" + 0x250.toChar)
}
}
}
"filterLatin()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterLatin("aBc" + 0x250.toChar) should be ("aBc")
}
}
}
"filterNotLatin()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotLatin("aBc" + 0x300.toChar) should be ("" + 0x300.toChar)
}
}
}
"filterLowerCase()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterLowerCase("aBc123" + 0x250.toChar) should be ("ac")
}
}
}
"filterNotLowerCase()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotLowerCase("aBc123" + 0x250.toChar) should be ("B123" + 0x250.toChar)
}
}
}
"filterNumeric()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNumeric("aBc123" + 0x250.toChar) should be ("123")
}
}
}
"filterNotNumeric()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotNumeric("aBc123" + 0x250.toChar) should be ("aBc" + 0x250.toChar)
}
}
}
"filterUpperCase()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterUpperCase("aBc123" + 0x250.toChar) should be ("B")
}
}
}
"filterNotUpperCase()" when passed {
"String" should returns {
"transformed String" in {
StringTransform.filterNotUpperCase("aBc123" + 0x250.toChar) should be ("ac123" + 0x250.toChar)
}
}
}
}}
|