We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
描述bug double 类型字符串转 Double 会造成溢出
怎么样重现这个bug Model
@interface MJDog : NSObject @property (copy, nonatomic) NSString *nickName; @property (assign, nonatomic) double salePrice; @property (assign, nonatomic) float runSpeed; @end
Test case:
func testInfiniteDouble() throws { let dict: [String: Any] = [ "nick_name": "旺财", "sale_price": "\(Double.greatestFiniteMagnitude)", "run_speed": "\(Float.greatestFiniteMagnitude)", ] guard let dog = MJDog.mj_object(withKeyValues: dict) else { fatalError("dog conversion failed") } XCTAssertEqual(dog.nickName, (dict["nick_name"] as! String)) // 这个会通不过 XCTAssertEqual(dog.salePrice, Double(dict["sale_price"] as! String)) XCTAssertEqual(dog.runSpeed, Float(dict["run_speed"] as! String)) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
描述bug
double 类型字符串转 Double 会造成溢出
怎么样重现这个bug
Model
Test case:
The text was updated successfully, but these errors were encountered: