summaryrefslogtreecommitdiff
path: root/core/source/test/scala/org/hashtree/stringmetric/filter/AsciiSymbolOnlyStringFilterSpec.scala
blob: fab4fb432eecb375173f389da958b3da1ba0ba15 (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
package org.hashtree.stringmetric.filter

import org.hashtree.stringmetric.ScalaTest
import org.hashtree.stringmetric.StringFilterDelegate
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
final class AsciiSymbolOnlyStringFilterSpec extends ScalaTest {
	private final val Filter = new StringFilterDelegate with AsciiSymbolOnlyStringFilter

	"AsciiSymbolOnlyStringFilter" should provide {
		"overloaded filter method" when passed {
			"String with mixed characters" should returns {
				"String with non-symbols removed" in {
					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)
				}
			}
		}
	}
}