1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-01 10:02:36 +03:00
vimr/VimRTests/PrefUtilsTest.swift
2016-11-18 18:59:44 +01:00

35 lines
932 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import XCTest
import Nimble
@testable import VimR
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(""))
}
}