From 86720f5b311d31e4f3198e520797bd5ef9b8c8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Sat, 7 Oct 2023 14:52:45 +0200 Subject: [PATCH] Add a test for `attributeValueClassName` CoreData itself sets this to the Foundation type. Which then later fails on loads? --- .../CoreDataAssumptionsTests.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Tests/ManagedModelTests/CoreDataAssumptionsTests.swift b/Tests/ManagedModelTests/CoreDataAssumptionsTests.swift index 3da87a0..204036d 100644 --- a/Tests/ManagedModelTests/CoreDataAssumptionsTests.swift +++ b/Tests/ManagedModelTests/CoreDataAssumptionsTests.swift @@ -67,4 +67,20 @@ final class CoreDataAssumptionsTests: XCTestCase { XCTAssertEqual(relationship.isOrdered, copiedRelationship.isOrdered) XCTAssertEqual(relationship.maxCount, copiedRelationship.maxCount) } + + + func testAttributeValueClassIsNotEmpty() throws { + do { + let attribute = NSAttributeDescription() + attribute.name = "Hello" + attribute.attributeType = .stringAttributeType + XCTAssertEqual(attribute.attributeValueClassName, "NSString") + } + do { + let attribute = NSAttributeDescription() + attribute.name = "Hello" + attribute.attributeType = .integer16AttributeType + XCTAssertEqual(attribute.attributeValueClassName, "NSNumber") + } + } }