You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class RealmExampleTests: XCTestCase {
func testRealmListOfStringsComparison() {
let strings = ["a", "b", "c"]
let list1 = List<String>()
list1.append(objectsIn: strings)
let list2 = List<String>()
list2.append(objectsIn: strings)
// 1. ok
XCTAssertTrue(list1 !== list2, "instances should not be identical")
// 2. fails
XCTAssertTrue(list1 == list2, "instances should be equal by `==` operator")
// 3. fails
XCTAssertTrue(list1.isEqual(list2), "instances should be equal by `isEqual` method")
// 4. ok
XCTAssertTrue(Array(list1) == Array(list2), "instances converted to Swift.Array should be equal")
}
}## Version of Realm and Tooling
ProductName: Mac OS X
ProductVersion: 10.12.6
BuildVersion: 16G1114
/Applications/Xcode-9.2.app/Contents/Developer
Xcode 9.2
Build version 9C40b
/Users/tomkraina/.rbenv/shims/pod
1.3.1
Realm (3.1.1)
RealmSwift (3.1.1)
/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)
/usr/local/bin/carthage
0.18.1
(not in use here)
/usr/bin/git
git version 2.14.3 (Apple Git-98)
The text was updated successfully, but these errors were encountered:
tomaskraina
changed the title
Comparing two List<String> objects
Bug: Comparing two List<String> objects fails
Mar 13, 2018
Goals
Compare 2 List objects with the same items.
Expected Results
The objects should be equal.
Actual Results
The objects are not equal.
Steps to Reproduce
Code Sample
Realm framework version: 3.1.1
Realm Object Server version: N/A
Xcode version: 9.2
iOS/OSX version: 10.12.6
Dependency manager + version: CocoaPods 1.3.1
The text was updated successfully, but these errors were encountered: