1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 23:36:08 +03:00
vimr/VimRTests/PrefUtilsTest.swift

34 lines
910 B
Swift
Raw Normal View History

2016-09-11 16:22:56 +03:00
/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import XCTest
import Nimble
class PrefUtilsTest: XCTestCase {
func testIgnorePatternsFromString() {
expect(PrefUtils.ignorePatterns(fromString: "a, b,c,,d")).to(equal(
Set(["a", "b", "c", "d"].map(FileItemIgnorePattern.init))
))
}
func testIgnorePatternsFromEmptyString() {
expect(PrefUtils.ignorePatterns(fromString: "")).to(equal(Set()))
}
func testIgnorePatternsFromEffectivelyEmptyString() {
expect(PrefUtils.ignorePatterns(fromString: ", , , ")).to(equal(Set()))
}
func testIgnorePatternStringFromSet() {
let set = Set(["c", "a", "d", "b"].map(FileItemIgnorePattern.init))
expect(PrefUtils.ignorePatternString(fromSet: set)).to(equal("a, b, c, d"))
}
func testIgnorePatternStringFromEmptySet() {
expect(PrefUtils.ignorePatternString(fromSet: Set())).to(equal(""))
}
}