-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBloomFilterTest.swift
More file actions
42 lines (29 loc) · 877 Bytes
/
BloomFilterTest.swift
File metadata and controls
42 lines (29 loc) · 877 Bytes
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
//
// BloomFilterTest.swift
// Circle
//
// Created by Jonathan Dalrymple on 06/11/2015.
//
import Foundation
import XCTest
@testable import Circle
class BloomFilterTest : XCTestCase {
func testAddElement() {
let subject = BloomFilter<String>()
XCTAssertTrue(subject.isEmpty)
XCTAssertTrue(subject.addElement("foo"))
XCTAssertFalse(subject.isEmpty)
}
func testContainsElement() {
let subject = BloomFilter<String>()
subject.addElement("foo")
XCTAssertTrue(subject.contains("foo"))
XCTAssertFalse(subject.contains("bar"))
}
func testIsEmpty() {
let subject = BloomFilter<String>()
XCTAssertTrue(subject.isEmpty)
subject.addElement("foo")
XCTAssertFalse(subject.isEmpty)
}
}