@@ -11,22 +11,28 @@ class swiftRoaringTests: XCTestCase {
11
11
12
12
func testAdd( ) {
13
13
rbm. add ( 35 )
14
- XCTAssertEqual ( rbm. contains ( 35 ) , true )
14
+ XCTAssertTrue ( rbm. contains ( 35 ) )
15
15
}
16
16
17
17
func testRemove( ) {
18
18
rbm. add ( 35 )
19
- rbm. remove ( 35 )
20
- XCTAssertEqual ( rbm. contains ( 35 ) , false )
19
+ XCTAssert ( rbm. remove ( 35 ) == 35 )
20
+ XCTAssertFalse ( rbm. contains ( 35 ) )
21
+ }
22
+
23
+ func testUpdate( ) {
24
+ rbm. add ( 35 )
25
+ XCTAssert ( rbm. update ( with: 35 ) == 35 )
26
+ XCTAssertTrue ( rbm. contains ( 35 ) )
21
27
}
22
28
23
29
func testRemoveAll( ) {
24
30
for k in stride ( from: 0 , to: 10000 , by: 100 ) {
25
31
rbm. add ( UInt32 ( k) )
26
32
}
27
- XCTAssertEqual ( rbm. isEmpty, false )
33
+ XCTAssertFalse ( rbm. isEmpty)
28
34
rbm. removeAll ( )
29
- XCTAssertEqual ( rbm. isEmpty, true )
35
+ XCTAssertTrue ( rbm. isEmpty)
30
36
}
31
37
32
38
func testRemoveAllWhere( ) {
@@ -43,17 +49,17 @@ class swiftRoaringTests: XCTestCase {
43
49
count += 1
44
50
}
45
51
for i in rbm {
46
- XCTAssertEqual ( rbm. contains ( i) , true )
52
+ XCTAssertTrue ( rbm. contains ( i) )
47
53
count -= 1
48
- if count < 0 { break }
54
+ if count < 0 { break }
49
55
}
50
56
XCTAssertEqual ( count, 0 )
51
57
}
52
58
53
59
func testInitRange( ) {
54
60
let rbmRange = RoaringBitmap ( min: 0 , max: 1000 , step: 50 )
55
61
for k in stride ( from: 0 , to: 1000 , by: 50 ) {
56
- XCTAssertEqual ( rbmRange. contains ( UInt32 ( k) ) , true )
62
+ XCTAssertTrue ( rbmRange. contains ( UInt32 ( k) ) )
57
63
}
58
64
}
59
65
@@ -66,11 +72,11 @@ class swiftRoaringTests: XCTestCase {
66
72
let array = [ 0 , 1 , 2 , 4 , 5 , 6 ]
67
73
let rbmArray = RoaringBitmap ( values: array. map { UInt32 ( $0) } )
68
74
for i in array {
69
- XCTAssertEqual ( rbmArray. contains ( UInt32 ( i) ) , true )
75
+ XCTAssertTrue ( rbmArray. contains ( UInt32 ( i) ) )
70
76
}
71
77
let l : RoaringBitmap = [ 0 , 1 , 2 , 4 , 5 , 6 ]
72
78
for i in array {
73
- XCTAssertEqual ( l. contains ( UInt32 ( i) ) , true )
79
+ XCTAssertTrue ( l. contains ( UInt32 ( i) ) )
74
80
}
75
81
}
76
82
@@ -378,10 +384,10 @@ class swiftRoaringTests: XCTestCase {
378
384
}
379
385
380
386
func testIsDisjoint( ) {
381
- let a : RoaringBitmap = [ 1 , 2 , 3 , 4 , 5 ]
382
- let b : RoaringBitmap = [ 6 , 7 , 8 , 9 , 10 ]
387
+ let a : RoaringBitmap = [ 1 , 2 , 3 , 4 , 5 ]
388
+ let b : RoaringBitmap = [ 6 , 7 , 8 , 9 , 10 ]
383
389
384
- let c : RoaringBitmap = [ 5 , 6 , 7 , 8 ]
390
+ let c : RoaringBitmap = [ 5 , 6 , 7 , 8 ]
385
391
386
392
XCTAssert ( a. isDisjoint ( with: b) )
387
393
XCTAssert ( !a. isDisjoint ( with: c) )
0 commit comments