mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-19 05:30:43 +00:00
Add QRecord as a handled type inside deepCopySimpleMap (e.g., so copy constructor won't need to warn about it and do slow serialization-based cloning).
This commit is contained in:
@ -151,6 +151,14 @@ class QRecordTest extends BaseTest
|
||||
QRecord recordWithArrayListValue = new QRecord().withValue("myList", originalArrayList);
|
||||
QRecord cloneWithArrayListValue = new QRecord(recordWithArrayListValue);
|
||||
|
||||
////////////////////////////////////////////
|
||||
// qrecord as a value inside another (!?) //
|
||||
////////////////////////////////////////////
|
||||
QRecord nestedQRecordValue = new QRecord().withValue("myRecord", new QRecord().withValue("A", 1));
|
||||
QRecord cloneWithNestedQRecord = new QRecord(nestedQRecordValue);
|
||||
assertEquals(1, ((QRecord) cloneWithNestedQRecord.getValue("myRecord")).getValueInteger("A"));
|
||||
assertNotSame(cloneWithNestedQRecord.getValue("myRecord"), nestedQRecordValue.getValue("myRecord"));
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// the clone list and original list should be equals (have contents that are equals), but not be the same (reference) //
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user