@@ -11,22 +11,28 @@ class swiftRoaringTests: XCTestCase {
1111
1212 func testAdd( ) {
1313 rbm. add ( 35 )
14- XCTAssertEqual ( rbm. contains ( 35 ) , true )
14+ XCTAssertTrue ( rbm. contains ( 35 ) )
1515 }
1616
1717 func testRemove( ) {
1818 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 ) )
2127 }
2228
2329 func testRemoveAll( ) {
2430 for k in stride ( from: 0 , to: 10000 , by: 100 ) {
2531 rbm. add ( UInt32 ( k) )
2632 }
27- XCTAssertEqual ( rbm. isEmpty, false )
33+ XCTAssertFalse ( rbm. isEmpty)
2834 rbm. removeAll ( )
29- XCTAssertEqual ( rbm. isEmpty, true )
35+ XCTAssertTrue ( rbm. isEmpty)
3036 }
3137
3238 func testRemoveAllWhere( ) {
@@ -43,17 +49,17 @@ class swiftRoaringTests: XCTestCase {
4349 count += 1
4450 }
4551 for i in rbm {
46- XCTAssertEqual ( rbm. contains ( i) , true )
52+ XCTAssertTrue ( rbm. contains ( i) )
4753 count -= 1
48- if count < 0 { break }
54+ if count < 0 { break }
4955 }
5056 XCTAssertEqual ( count, 0 )
5157 }
5258
5359 func testInitRange( ) {
5460 let rbmRange = RoaringBitmap ( min: 0 , max: 1000 , step: 50 )
5561 for k in stride ( from: 0 , to: 1000 , by: 50 ) {
56- XCTAssertEqual ( rbmRange. contains ( UInt32 ( k) ) , true )
62+ XCTAssertTrue ( rbmRange. contains ( UInt32 ( k) ) )
5763 }
5864 }
5965
@@ -66,11 +72,11 @@ class swiftRoaringTests: XCTestCase {
6672 let array = [ 0 , 1 , 2 , 4 , 5 , 6 ]
6773 let rbmArray = RoaringBitmap ( values: array. map { UInt32 ( $0) } )
6874 for i in array {
69- XCTAssertEqual ( rbmArray. contains ( UInt32 ( i) ) , true )
75+ XCTAssertTrue ( rbmArray. contains ( UInt32 ( i) ) )
7076 }
7177 let l : RoaringBitmap = [ 0 , 1 , 2 , 4 , 5 , 6 ]
7278 for i in array {
73- XCTAssertEqual ( l. contains ( UInt32 ( i) ) , true )
79+ XCTAssertTrue ( l. contains ( UInt32 ( i) ) )
7480 }
7581 }
7682
@@ -378,10 +384,10 @@ class swiftRoaringTests: XCTestCase {
378384 }
379385
380386 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 ]
383389
384- let c : RoaringBitmap = [ 5 , 6 , 7 , 8 ]
390+ let c : RoaringBitmap = [ 5 , 6 , 7 , 8 ]
385391
386392 XCTAssert ( a. isDisjoint ( with: b) )
387393 XCTAssert ( !a. isDisjoint ( with: c) )
0 commit comments