From 8ff7a8b3be378b7e7b687f1476238cb488f4d28b Mon Sep 17 00:00:00 2001 From: Minster Date: Mon, 22 Jan 2018 17:33:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YYModelTests/YYTestAutoTypeConvert.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/YYModelTests/YYTestAutoTypeConvert.m b/YYModelTests/YYTestAutoTypeConvert.m index 2de2d2f..ec3519e 100644 --- a/YYModelTests/YYTestAutoTypeConvert.m +++ b/YYModelTests/YYTestAutoTypeConvert.m @@ -430,6 +430,20 @@ - (void)testArrayAndDic { array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:[YYTestHelper jsonObjectFromString:json]]; XCTAssertTrue(array.count == 3); XCTAssertTrue([array.firstObject isKindOfClass:[YYTestAutoTypeModel class]]); + + + json = @"[[[{\"v\":1},{\"v\":2},{\"v\":3}]]]"; + NSArray *array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:json]; + XCTAssertTrue(array.count == 1); + XCTAssertTrue([array.firstObject.firstObject.firstObject isKindOfClass:[YYTestAutoTypeModel class]]); + + array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:[YYTestHelper jsonDataFromString:json]]; + XCTAssertTrue(array.count == 1); + XCTAssertTrue([array.firstObject.firstObject.firstObject isKindOfClass:[YYTestAutoTypeModel class]]); + + array = [NSArray yy_modelArrayWithClass:YYTestAutoTypeModel.class json:[YYTestHelper jsonObjectFromString:json]]; + XCTAssertTrue(array.count == 1); + XCTAssertTrue([array.firstObject.firstObject.firstObject isKindOfClass:[YYTestAutoTypeModel class]]); json = @"{\"a\":{\"v\":1},\"b\":{\"v\":2},\"c\":{\"v\":3}}";