Investigate dictionary test randomly failing
Machx opened this issue · 1 comments
Machx commented
func testDictionaryLiteralAndSetLimit() {
var dictionary: RollingDictionary = ["A": 1, "B": 2]
XCTAssertNotNil(dictionary)
XCTAssertEqual(dictionary["A"], 1)
XCTAssertEqual(dictionary["B"], 2)
dictionary.setLimit(1)
XCTAssertEqual(dictionary.getKeyLimit(), 1)
//
XCTAssertNil(dictionary["A"]) // <-- FAIL HERE
XCTAssertNotNil(dictionary["B"]) // <-- FAIL HERE
}
The test randomly fails. I'm guessing the key orders aren't preserved or something like that.