@fluid-experimental/tree 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/api-report/experimental-tree.api.md +2 -2
- package/dist/ChangeCompression.d.ts +2 -2
- package/dist/ChangeCompression.d.ts.map +1 -1
- package/dist/ChangeCompression.js +1 -1
- package/dist/ChangeCompression.js.map +1 -1
- package/dist/ChangeTypes.d.ts +1 -1
- package/dist/ChangeTypes.d.ts.map +1 -1
- package/dist/ChangeTypes.js +4 -4
- package/dist/ChangeTypes.js.map +1 -1
- package/dist/Checkout.d.ts +3 -3
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +17 -17
- package/dist/Checkout.js.map +1 -1
- package/dist/EditLog.d.ts +1 -1
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +9 -9
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +3 -3
- package/dist/EditUtilities.d.ts.map +1 -1
- package/dist/EditUtilities.js +6 -6
- package/dist/EditUtilities.js.map +1 -1
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +23 -23
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +1 -1
- package/dist/HistoryEditFactory.d.ts.map +1 -1
- package/dist/HistoryEditFactory.js +7 -7
- package/dist/HistoryEditFactory.js.map +1 -1
- package/dist/IdConversion.d.ts.map +1 -1
- package/dist/IdConversion.js.map +1 -1
- package/dist/LogViewer.d.ts +2 -2
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +7 -7
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts.map +1 -1
- package/dist/MergeHealth.js +1 -1
- package/dist/MergeHealth.js.map +1 -1
- package/dist/NodeIdUtilities.d.ts +1 -1
- package/dist/NodeIdUtilities.d.ts.map +1 -1
- package/dist/NodeIdUtilities.js +1 -1
- package/dist/NodeIdUtilities.js.map +1 -1
- package/dist/PayloadUtilities.d.ts.map +1 -1
- package/dist/PayloadUtilities.js +2 -2
- package/dist/PayloadUtilities.js.map +1 -1
- package/dist/ReconciliationPath.d.ts +1 -1
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +2 -2
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +2 -2
- package/dist/RevisionView.d.ts.map +1 -1
- package/dist/RevisionView.js.map +1 -1
- package/dist/SerializationUtilities.d.ts +1 -1
- package/dist/SerializationUtilities.d.ts.map +1 -1
- package/dist/SerializationUtilities.js.map +1 -1
- package/dist/SharedTree.d.ts +8 -7
- package/dist/SharedTree.d.ts.map +1 -1
- package/dist/SharedTree.js +78 -78
- package/dist/SharedTree.js.map +1 -1
- package/dist/SharedTreeEncoder.d.ts +1 -1
- package/dist/SharedTreeEncoder.d.ts.map +1 -1
- package/dist/SharedTreeEncoder.js +31 -31
- package/dist/SharedTreeEncoder.js.map +1 -1
- package/dist/Summary.d.ts +2 -2
- package/dist/Summary.d.ts.map +1 -1
- package/dist/Summary.js +2 -2
- package/dist/Summary.js.map +1 -1
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +1 -1
- package/dist/SummaryTestUtilities.d.ts.map +1 -1
- package/dist/SummaryTestUtilities.js.map +1 -1
- package/dist/Transaction.d.ts +3 -3
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +3 -3
- package/dist/Transaction.js.map +1 -1
- package/dist/TransactionInternal.d.ts +3 -3
- package/dist/TransactionInternal.d.ts.map +1 -1
- package/dist/TransactionInternal.js +6 -6
- package/dist/TransactionInternal.js.map +1 -1
- package/dist/TreeCompressor.d.ts +5 -1
- package/dist/TreeCompressor.d.ts.map +1 -1
- package/dist/TreeCompressor.js +5 -5
- package/dist/TreeCompressor.js.map +1 -1
- package/dist/TreeNodeHandle.d.ts +1 -1
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +1 -1
- package/dist/TreeView.d.ts.map +1 -1
- package/dist/TreeView.js +2 -3
- package/dist/TreeView.js.map +1 -1
- package/dist/UuidUtilities.d.ts.map +1 -1
- package/dist/UuidUtilities.js.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.js +3 -3
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/IdCompressor.d.ts +1 -1
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
- package/dist/id-compressor/IdCompressor.js +25 -26
- package/dist/id-compressor/IdCompressor.js.map +1 -1
- package/dist/id-compressor/IdRange.d.ts.map +1 -1
- package/dist/id-compressor/IdRange.js +2 -2
- package/dist/id-compressor/IdRange.js.map +1 -1
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
- package/dist/id-compressor/NumericUuid.js +2 -1
- package/dist/id-compressor/NumericUuid.js.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.js +8 -9
- package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.js +11 -11
- package/dist/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/dist/migration-shim/migrationShim.d.ts +8 -4
- package/dist/migration-shim/migrationShim.d.ts.map +1 -1
- package/dist/migration-shim/migrationShim.js +13 -13
- package/dist/migration-shim/migrationShim.js.map +1 -1
- package/dist/migration-shim/migrationShimFactory.d.ts +2 -2
- package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/migrationShimFactory.js +2 -2
- package/dist/migration-shim/migrationShimFactory.js.map +1 -1
- package/dist/migration-shim/packageVersion.d.ts +0 -2
- package/dist/migration-shim/packageVersion.d.ts.map +1 -1
- package/dist/migration-shim/packageVersion.js +0 -2
- package/dist/migration-shim/packageVersion.js.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.js +8 -8
- package/dist/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/dist/migration-shim/sharedTreeShim.d.ts +2 -2
- package/dist/migration-shim/sharedTreeShim.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeShim.js +8 -4
- package/dist/migration-shim/sharedTreeShim.js.map +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.d.ts +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.js +2 -2
- package/dist/migration-shim/sharedTreeShimFactory.js.map +1 -1
- package/dist/migration-shim/shimChannelServices.d.ts +1 -1
- package/dist/migration-shim/shimChannelServices.d.ts.map +1 -1
- package/dist/migration-shim/shimChannelServices.js.map +1 -1
- package/dist/migration-shim/shimDeltaConnection.d.ts +1 -1
- package/dist/migration-shim/shimDeltaConnection.d.ts.map +1 -1
- package/dist/migration-shim/shimDeltaConnection.js +2 -2
- package/dist/migration-shim/shimDeltaConnection.js.map +1 -1
- package/dist/migration-shim/shimHandle.d.ts.map +1 -1
- package/dist/migration-shim/shimHandle.js.map +1 -1
- package/dist/migration-shim/types.d.ts +1 -1
- package/dist/migration-shim/types.d.ts.map +1 -1
- package/dist/migration-shim/types.js.map +1 -1
- package/dist/migration-shim/utils.d.ts +1 -1
- package/dist/migration-shim/utils.d.ts.map +1 -1
- package/dist/migration-shim/utils.js.map +1 -1
- package/dist/persisted-types/0.0.2.d.ts +1 -1
- package/dist/persisted-types/0.0.2.d.ts.map +1 -1
- package/dist/persisted-types/0.0.2.js.map +1 -1
- package/dist/persisted-types/0.1.1.d.ts +1 -1
- package/dist/persisted-types/0.1.1.d.ts.map +1 -1
- package/dist/persisted-types/0.1.1.js +3 -3
- package/dist/persisted-types/0.1.1.js.map +1 -1
- package/lib/ChangeCompression.d.ts +2 -2
- package/lib/ChangeCompression.d.ts.map +1 -1
- package/lib/ChangeCompression.js +1 -1
- package/lib/ChangeCompression.js.map +1 -1
- package/lib/ChangeTypes.d.ts +1 -1
- package/lib/ChangeTypes.d.ts.map +1 -1
- package/lib/ChangeTypes.js +2 -2
- package/lib/ChangeTypes.js.map +1 -1
- package/lib/Checkout.d.ts +3 -3
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +4 -4
- package/lib/Checkout.js.map +1 -1
- package/lib/EditLog.d.ts +1 -1
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +2 -2
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +3 -3
- package/lib/EditUtilities.d.ts.map +1 -1
- package/lib/EditUtilities.js +5 -5
- package/lib/EditUtilities.js.map +1 -1
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +2 -2
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +1 -1
- package/lib/HistoryEditFactory.d.ts.map +1 -1
- package/lib/HistoryEditFactory.js +5 -5
- package/lib/HistoryEditFactory.js.map +1 -1
- package/lib/IdConversion.d.ts.map +1 -1
- package/lib/IdConversion.js.map +1 -1
- package/lib/LogViewer.d.ts +2 -2
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +3 -3
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts.map +1 -1
- package/lib/MergeHealth.js +1 -1
- package/lib/MergeHealth.js.map +1 -1
- package/lib/NodeIdUtilities.d.ts +1 -1
- package/lib/NodeIdUtilities.d.ts.map +1 -1
- package/lib/NodeIdUtilities.js +1 -1
- package/lib/NodeIdUtilities.js.map +1 -1
- package/lib/PayloadUtilities.d.ts.map +1 -1
- package/lib/PayloadUtilities.js +1 -1
- package/lib/PayloadUtilities.js.map +1 -1
- package/lib/ReconciliationPath.d.ts +1 -1
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +2 -2
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +2 -2
- package/lib/RevisionView.d.ts.map +1 -1
- package/lib/RevisionView.js.map +1 -1
- package/lib/SerializationUtilities.d.ts +1 -1
- package/lib/SerializationUtilities.d.ts.map +1 -1
- package/lib/SerializationUtilities.js.map +1 -1
- package/lib/SharedTree.d.ts +8 -7
- package/lib/SharedTree.d.ts.map +1 -1
- package/lib/SharedTree.js +13 -13
- package/lib/SharedTree.js.map +1 -1
- package/lib/SharedTreeEncoder.d.ts +1 -1
- package/lib/SharedTreeEncoder.d.ts.map +1 -1
- package/lib/SharedTreeEncoder.js +5 -5
- package/lib/SharedTreeEncoder.js.map +1 -1
- package/lib/Summary.d.ts +2 -2
- package/lib/Summary.d.ts.map +1 -1
- package/lib/Summary.js +1 -1
- package/lib/Summary.js.map +1 -1
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +1 -1
- package/lib/SummaryTestUtilities.d.ts.map +1 -1
- package/lib/SummaryTestUtilities.js.map +1 -1
- package/lib/Transaction.d.ts +3 -3
- package/lib/Transaction.d.ts.map +1 -1
- package/lib/Transaction.js +3 -3
- package/lib/Transaction.js.map +1 -1
- package/lib/TransactionInternal.d.ts +3 -3
- package/lib/TransactionInternal.d.ts.map +1 -1
- package/lib/TransactionInternal.js +3 -3
- package/lib/TransactionInternal.js.map +1 -1
- package/lib/TreeCompressor.d.ts +5 -1
- package/lib/TreeCompressor.d.ts.map +1 -1
- package/lib/TreeCompressor.js +2 -2
- package/lib/TreeCompressor.js.map +1 -1
- package/lib/TreeNodeHandle.d.ts +1 -1
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +1 -1
- package/lib/TreeView.d.ts.map +1 -1
- package/lib/TreeView.js +1 -2
- package/lib/TreeView.js.map +1 -1
- package/lib/UuidUtilities.d.ts.map +1 -1
- package/lib/UuidUtilities.js +1 -1
- package/lib/UuidUtilities.js.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/IdCompressor.d.ts +1 -1
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
- package/lib/id-compressor/IdCompressor.js +4 -5
- package/lib/id-compressor/IdCompressor.js.map +1 -1
- package/lib/id-compressor/IdRange.d.ts.map +1 -1
- package/lib/id-compressor/IdRange.js +1 -1
- package/lib/id-compressor/IdRange.js.map +1 -1
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
- package/lib/id-compressor/NumericUuid.js +2 -1
- package/lib/id-compressor/NumericUuid.js.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.js +1 -2
- package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/lib/migration-shim/migrationShim.d.ts +8 -4
- package/lib/migration-shim/migrationShim.d.ts.map +1 -1
- package/lib/migration-shim/migrationShim.js +3 -3
- package/lib/migration-shim/migrationShim.js.map +1 -1
- package/lib/migration-shim/migrationShimFactory.d.ts +2 -2
- package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/migrationShimFactory.js +1 -1
- package/lib/migration-shim/migrationShimFactory.js.map +1 -1
- package/lib/migration-shim/packageVersion.d.ts +0 -2
- package/lib/migration-shim/packageVersion.d.ts.map +1 -1
- package/lib/migration-shim/packageVersion.js +0 -2
- package/lib/migration-shim/packageVersion.js.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/lib/migration-shim/sharedTreeShim.d.ts +2 -2
- package/lib/migration-shim/sharedTreeShim.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeShim.js +6 -2
- package/lib/migration-shim/sharedTreeShim.js.map +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.d.ts +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.js +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.js.map +1 -1
- package/lib/migration-shim/shimChannelServices.d.ts +1 -1
- package/lib/migration-shim/shimChannelServices.d.ts.map +1 -1
- package/lib/migration-shim/shimChannelServices.js.map +1 -1
- package/lib/migration-shim/shimDeltaConnection.d.ts +1 -1
- package/lib/migration-shim/shimDeltaConnection.d.ts.map +1 -1
- package/lib/migration-shim/shimDeltaConnection.js +1 -1
- package/lib/migration-shim/shimDeltaConnection.js.map +1 -1
- package/lib/migration-shim/shimHandle.d.ts.map +1 -1
- package/lib/migration-shim/shimHandle.js.map +1 -1
- package/lib/migration-shim/types.d.ts +1 -1
- package/lib/migration-shim/types.d.ts.map +1 -1
- package/lib/migration-shim/types.js.map +1 -1
- package/lib/migration-shim/utils.d.ts +1 -1
- package/lib/migration-shim/utils.d.ts.map +1 -1
- package/lib/migration-shim/utils.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +1 -1
- package/lib/persisted-types/0.0.2.d.ts.map +1 -1
- package/lib/persisted-types/0.0.2.js.map +1 -1
- package/lib/persisted-types/0.1.1.d.ts +1 -1
- package/lib/persisted-types/0.1.1.d.ts.map +1 -1
- package/lib/persisted-types/0.1.1.js +1 -1
- package/lib/persisted-types/0.1.1.js.map +1 -1
- package/package.json +33 -32
- package/src/ChangeCompression.ts +8 -8
- package/src/ChangeTypes.ts +5 -4
- package/src/Checkout.ts +9 -7
- package/src/EditLog.ts +4 -3
- package/src/EditUtilities.ts +9 -8
- package/src/Forest.ts +3 -2
- package/src/HistoryEditFactory.ts +12 -11
- package/src/IdConversion.ts +2 -2
- package/src/LogViewer.ts +5 -4
- package/src/MergeHealth.ts +2 -1
- package/src/NodeIdUtilities.ts +2 -2
- package/src/PayloadUtilities.ts +2 -1
- package/src/ReconciliationPath.ts +1 -1
- package/src/RevisionValueCache.ts +3 -2
- package/src/RevisionView.ts +3 -3
- package/src/SerializationUtilities.ts +1 -1
- package/src/SharedTree.ts +46 -49
- package/src/SharedTreeEncoder.ts +30 -29
- package/src/Summary.ts +5 -3
- package/src/SummaryBackCompatibility.ts +1 -0
- package/src/SummaryTestUtilities.ts +2 -1
- package/src/Transaction.ts +7 -6
- package/src/TransactionInternal.ts +17 -16
- package/src/TreeCompressor.ts +6 -4
- package/src/TreeNodeHandle.ts +2 -2
- package/src/TreeView.ts +3 -3
- package/src/UuidUtilities.ts +2 -1
- package/src/id-compressor/AppendOnlySortedMap.ts +2 -1
- package/src/id-compressor/IdCompressor.ts +18 -17
- package/src/id-compressor/IdRange.ts +2 -1
- package/src/id-compressor/NumericUuid.ts +1 -1
- package/src/id-compressor/SessionIdNormalizer.ts +3 -3
- package/src/migration-shim/migrationDeltaHandler.ts +3 -2
- package/src/migration-shim/migrationShim.ts +14 -10
- package/src/migration-shim/migrationShimFactory.ts +6 -4
- package/src/migration-shim/packageVersion.ts +0 -2
- package/src/migration-shim/sharedTreeDeltaHandler.ts +3 -2
- package/src/migration-shim/sharedTreeShim.ts +7 -5
- package/src/migration-shim/sharedTreeShimFactory.ts +3 -3
- package/src/migration-shim/shimChannelServices.ts +1 -1
- package/src/migration-shim/shimDeltaConnection.ts +3 -2
- package/src/migration-shim/shimHandle.ts +1 -0
- package/src/migration-shim/types.ts +3 -1
- package/src/migration-shim/utils.ts +2 -1
- package/src/persisted-types/0.0.2.ts +2 -2
- package/src/persisted-types/0.1.1.ts +10 -8
- package/dist/tree-alpha.d.ts +0 -2901
- package/dist/tree-beta.d.ts +0 -348
- package/dist/tree-public.d.ts +0 -348
- package/dist/tree-untrimmed.d.ts +0 -3820
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +0 -6
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +0 -1
- package/lib/test/AppendOnlySortedMap.perf.tests.js +0 -49
- package/lib/test/AppendOnlySortedMap.perf.tests.js.map +0 -1
- package/lib/test/AppendOnlySortedMap.tests.d.ts +0 -6
- package/lib/test/AppendOnlySortedMap.tests.d.ts.map +0 -1
- package/lib/test/AppendOnlySortedMap.tests.js +0 -213
- package/lib/test/AppendOnlySortedMap.tests.js.map +0 -1
- package/lib/test/ChangeCompression.tests.d.ts +0 -6
- package/lib/test/ChangeCompression.tests.d.ts.map +0 -1
- package/lib/test/ChangeCompression.tests.js +0 -154
- package/lib/test/ChangeCompression.tests.js.map +0 -1
- package/lib/test/Checkout.tests.d.ts +0 -10
- package/lib/test/Checkout.tests.d.ts.map +0 -1
- package/lib/test/Checkout.tests.js +0 -460
- package/lib/test/Checkout.tests.js.map +0 -1
- package/lib/test/Common.tests.d.ts +0 -6
- package/lib/test/Common.tests.d.ts.map +0 -1
- package/lib/test/Common.tests.js +0 -102
- package/lib/test/Common.tests.js.map +0 -1
- package/lib/test/EagerCheckout.tests.d.ts +0 -6
- package/lib/test/EagerCheckout.tests.d.ts.map +0 -1
- package/lib/test/EagerCheckout.tests.js +0 -20
- package/lib/test/EagerCheckout.tests.js.map +0 -1
- package/lib/test/Edit.tests.d.ts +0 -6
- package/lib/test/Edit.tests.d.ts.map +0 -1
- package/lib/test/Edit.tests.js +0 -60
- package/lib/test/Edit.tests.js.map +0 -1
- package/lib/test/EditLog.perf.tests.d.ts +0 -6
- package/lib/test/EditLog.perf.tests.d.ts.map +0 -1
- package/lib/test/EditLog.perf.tests.js +0 -41
- package/lib/test/EditLog.perf.tests.js.map +0 -1
- package/lib/test/EditLog.tests.d.ts +0 -6
- package/lib/test/EditLog.tests.d.ts.map +0 -1
- package/lib/test/EditLog.tests.js +0 -355
- package/lib/test/EditLog.tests.js.map +0 -1
- package/lib/test/EditUtilities.tests.d.ts +0 -6
- package/lib/test/EditUtilities.tests.d.ts.map +0 -1
- package/lib/test/EditUtilities.tests.js +0 -512
- package/lib/test/EditUtilities.tests.js.map +0 -1
- package/lib/test/Forest.perf.tests.d.ts +0 -6
- package/lib/test/Forest.perf.tests.d.ts.map +0 -1
- package/lib/test/Forest.perf.tests.js +0 -135
- package/lib/test/Forest.perf.tests.js.map +0 -1
- package/lib/test/Forest.tests.d.ts +0 -6
- package/lib/test/Forest.tests.d.ts.map +0 -1
- package/lib/test/Forest.tests.js +0 -213
- package/lib/test/Forest.tests.js.map +0 -1
- package/lib/test/GenericTransaction.tests.d.ts +0 -6
- package/lib/test/GenericTransaction.tests.d.ts.map +0 -1
- package/lib/test/GenericTransaction.tests.js +0 -31
- package/lib/test/GenericTransaction.tests.js.map +0 -1
- package/lib/test/HistoryEditFactory.tests.d.ts +0 -6
- package/lib/test/HistoryEditFactory.tests.d.ts.map +0 -1
- package/lib/test/HistoryEditFactory.tests.js +0 -170
- package/lib/test/HistoryEditFactory.tests.js.map +0 -1
- package/lib/test/IdCompressor.perf.tests.d.ts +0 -6
- package/lib/test/IdCompressor.perf.tests.d.ts.map +0 -1
- package/lib/test/IdCompressor.perf.tests.js +0 -290
- package/lib/test/IdCompressor.perf.tests.js.map +0 -1
- package/lib/test/IdCompressor.tests.d.ts +0 -6
- package/lib/test/IdCompressor.tests.d.ts.map +0 -1
- package/lib/test/IdCompressor.tests.js +0 -1542
- package/lib/test/IdCompressor.tests.js.map +0 -1
- package/lib/test/IdConversion.tests.d.ts +0 -6
- package/lib/test/IdConversion.tests.d.ts.map +0 -1
- package/lib/test/IdConversion.tests.js +0 -36
- package/lib/test/IdConversion.tests.js.map +0 -1
- package/lib/test/LazyCheckout.tests.d.ts +0 -6
- package/lib/test/LazyCheckout.tests.d.ts.map +0 -1
- package/lib/test/LazyCheckout.tests.js +0 -22
- package/lib/test/LazyCheckout.tests.js.map +0 -1
- package/lib/test/LogViewer.tests.d.ts +0 -6
- package/lib/test/LogViewer.tests.d.ts.map +0 -1
- package/lib/test/LogViewer.tests.js +0 -588
- package/lib/test/LogViewer.tests.js.map +0 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts +0 -6
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +0 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +0 -351
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +0 -1
- package/lib/test/NumericUuid.perf.tests.d.ts +0 -6
- package/lib/test/NumericUuid.perf.tests.d.ts.map +0 -1
- package/lib/test/NumericUuid.perf.tests.js +0 -68
- package/lib/test/NumericUuid.perf.tests.js.map +0 -1
- package/lib/test/NumericUuid.tests.d.ts +0 -6
- package/lib/test/NumericUuid.tests.d.ts.map +0 -1
- package/lib/test/NumericUuid.tests.js +0 -192
- package/lib/test/NumericUuid.tests.js.map +0 -1
- package/lib/test/RevisionValueCache.tests.d.ts +0 -6
- package/lib/test/RevisionValueCache.tests.d.ts.map +0 -1
- package/lib/test/RevisionValueCache.tests.js +0 -106
- package/lib/test/RevisionValueCache.tests.js.map +0 -1
- package/lib/test/RevisionView.tests.d.ts +0 -6
- package/lib/test/RevisionView.tests.d.ts.map +0 -1
- package/lib/test/RevisionView.tests.js +0 -131
- package/lib/test/RevisionView.tests.js.map +0 -1
- package/lib/test/SessionIdNormalizer.tests.d.ts +0 -6
- package/lib/test/SessionIdNormalizer.tests.d.ts.map +0 -1
- package/lib/test/SessionIdNormalizer.tests.js +0 -377
- package/lib/test/SessionIdNormalizer.tests.js.map +0 -1
- package/lib/test/SharedTree.fuzz.tests.d.ts +0 -6
- package/lib/test/SharedTree.fuzz.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.fuzz.tests.js +0 -9
- package/lib/test/SharedTree.fuzz.tests.js.map +0 -1
- package/lib/test/SharedTree.perf.tests.d.ts +0 -6
- package/lib/test/SharedTree.perf.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.perf.tests.js +0 -39
- package/lib/test/SharedTree.perf.tests.js.map +0 -1
- package/lib/test/SharedTree.tests.d.ts +0 -6
- package/lib/test/SharedTree.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.tests.js +0 -22
- package/lib/test/SharedTree.tests.js.map +0 -1
- package/lib/test/StringInterner.tests.d.ts +0 -6
- package/lib/test/StringInterner.tests.d.ts.map +0 -1
- package/lib/test/StringInterner.tests.js +0 -73
- package/lib/test/StringInterner.tests.js.map +0 -1
- package/lib/test/Summary.tests.d.ts +0 -7
- package/lib/test/Summary.tests.d.ts.map +0 -1
- package/lib/test/Summary.tests.js +0 -386
- package/lib/test/Summary.tests.js.map +0 -1
- package/lib/test/Transaction.tests.d.ts +0 -6
- package/lib/test/Transaction.tests.d.ts.map +0 -1
- package/lib/test/Transaction.tests.js +0 -124
- package/lib/test/Transaction.tests.js.map +0 -1
- package/lib/test/TransactionInternal.tests.d.ts +0 -6
- package/lib/test/TransactionInternal.tests.d.ts.map +0 -1
- package/lib/test/TransactionInternal.tests.js +0 -576
- package/lib/test/TransactionInternal.tests.js.map +0 -1
- package/lib/test/TreeCompression.tests.d.ts +0 -6
- package/lib/test/TreeCompression.tests.d.ts.map +0 -1
- package/lib/test/TreeCompression.tests.js +0 -291
- package/lib/test/TreeCompression.tests.js.map +0 -1
- package/lib/test/TreeView.tests.d.ts +0 -6
- package/lib/test/TreeView.tests.d.ts.map +0 -1
- package/lib/test/TreeView.tests.js +0 -178
- package/lib/test/TreeView.tests.js.map +0 -1
- package/lib/test/UndoRedoHandler.tests.d.ts +0 -6
- package/lib/test/UndoRedoHandler.tests.d.ts.map +0 -1
- package/lib/test/UndoRedoHandler.tests.js +0 -37
- package/lib/test/UndoRedoHandler.tests.js.map +0 -1
- package/lib/test/fuzz/Generators.d.ts +0 -8
- package/lib/test/fuzz/Generators.d.ts.map +0 -1
- package/lib/test/fuzz/Generators.js +0 -345
- package/lib/test/fuzz/Generators.js.map +0 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +0 -23
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +0 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.js +0 -241
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +0 -1
- package/lib/test/fuzz/Types.d.ts +0 -136
- package/lib/test/fuzz/Types.d.ts.map +0 -1
- package/lib/test/fuzz/Types.js +0 -6
- package/lib/test/fuzz/Types.js.map +0 -1
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +0 -246
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +0 -1
- package/lib/test/utilities/IdCompressorTestUtilities.js +0 -608
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +0 -1
- package/lib/test/utilities/MockTransaction.d.ts +0 -35
- package/lib/test/utilities/MockTransaction.d.ts.map +0 -1
- package/lib/test/utilities/MockTransaction.js +0 -51
- package/lib/test/utilities/MockTransaction.js.map +0 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +0 -12
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +0 -1
- package/lib/test/utilities/PendingLocalStateTests.js +0 -223
- package/lib/test/utilities/PendingLocalStateTests.js.map +0 -1
- package/lib/test/utilities/SharedTreeTests.d.ts +0 -12
- package/lib/test/utilities/SharedTreeTests.d.ts.map +0 -1
- package/lib/test/utilities/SharedTreeTests.js +0 -949
- package/lib/test/utilities/SharedTreeTests.js.map +0 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +0 -11
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +0 -1
- package/lib/test/utilities/SharedTreeVersioningTests.js +0 -439
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +0 -1
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts +0 -10
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +0 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js +0 -105
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +0 -1
- package/lib/test/utilities/SummarySizeTests.d.ts +0 -11
- package/lib/test/utilities/SummarySizeTests.d.ts.map +0 -1
- package/lib/test/utilities/SummarySizeTests.js +0 -160
- package/lib/test/utilities/SummarySizeTests.js.map +0 -1
- package/lib/test/utilities/TestCommon.d.ts +0 -13
- package/lib/test/utilities/TestCommon.d.ts.map +0 -1
- package/lib/test/utilities/TestCommon.js +0 -19
- package/lib/test/utilities/TestCommon.js.map +0 -1
- package/lib/test/utilities/TestNode.d.ts +0 -140
- package/lib/test/utilities/TestNode.d.ts.map +0 -1
- package/lib/test/utilities/TestNode.js +0 -282
- package/lib/test/utilities/TestNode.js.map +0 -1
- package/lib/test/utilities/TestSerializer.d.ts +0 -24
- package/lib/test/utilities/TestSerializer.d.ts.map +0 -1
- package/lib/test/utilities/TestSerializer.js +0 -40
- package/lib/test/utilities/TestSerializer.js.map +0 -1
- package/lib/test/utilities/TestUtilities.d.ts +0 -212
- package/lib/test/utilities/TestUtilities.d.ts.map +0 -1
- package/lib/test/utilities/TestUtilities.js +0 -413
- package/lib/test/utilities/TestUtilities.js.map +0 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +0 -32
- package/lib/test/utilities/UndoRedoTests.d.ts.map +0 -1
- package/lib/test/utilities/UndoRedoTests.js +0 -317
- package/lib/test/utilities/UndoRedoTests.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { expect } from 'chai';
|
|
6
|
-
import { assert } from '@fluidframework/core-utils';
|
|
7
|
-
import { MockFluidDataStoreRuntime } from '@fluidframework/test-runtime-utils';
|
|
8
|
-
import { FluidSerializer } from '@fluidframework/shared-object-base';
|
|
9
|
-
import { getChangeNodeFromView } from '../SerializationUtilities.js';
|
|
10
|
-
import { noop } from '../Common.js';
|
|
11
|
-
import { convertTreeNodes, deepCompareNodes, internalizeBuildNode, PlaceValidationResult, RangeValidationResultKind, validateStablePlace, validateStableRange, walkTree, } from '../EditUtilities.js';
|
|
12
|
-
import { Side } from '../persisted-types/index.js';
|
|
13
|
-
import { comparePayloads } from '../PayloadUtilities.js';
|
|
14
|
-
import { refreshTestTree } from './utilities/TestUtilities.js';
|
|
15
|
-
describe('EditUtilities', () => {
|
|
16
|
-
const testTree = refreshTestTree(undefined, undefined, /* expensiveValidation: */ true);
|
|
17
|
-
describe('validateStablePlace', () => {
|
|
18
|
-
it('accepts valid places', () => {
|
|
19
|
-
expect(validateStablePlace(testTree.view, {
|
|
20
|
-
referenceSibling: testTree.left.identifier,
|
|
21
|
-
side: Side.Before,
|
|
22
|
-
})).deep.equals({
|
|
23
|
-
result: PlaceValidationResult.Valid,
|
|
24
|
-
referenceSibling: testTree.left.identifier,
|
|
25
|
-
side: Side.Before,
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
it('detects malformed places', () => {
|
|
29
|
-
expect(validateStablePlace(testTree.view, {
|
|
30
|
-
referenceTrait: testTree.left.traitLocation,
|
|
31
|
-
referenceSibling: testTree.left.identifier,
|
|
32
|
-
side: Side.Before,
|
|
33
|
-
})).deep.equals({ result: PlaceValidationResult.Malformed });
|
|
34
|
-
});
|
|
35
|
-
it('detects missing siblings', () => {
|
|
36
|
-
expect(validateStablePlace(testTree.view, {
|
|
37
|
-
referenceSibling: testTree.generateNodeId(),
|
|
38
|
-
side: Side.Before,
|
|
39
|
-
})).deep.equals({ result: PlaceValidationResult.MissingSibling });
|
|
40
|
-
});
|
|
41
|
-
it('detects missing parents', () => {
|
|
42
|
-
expect(validateStablePlace(testTree.view, {
|
|
43
|
-
referenceTrait: {
|
|
44
|
-
parent: testTree.generateNodeId(),
|
|
45
|
-
label: testTree.left.traitLabel,
|
|
46
|
-
},
|
|
47
|
-
side: Side.Before,
|
|
48
|
-
})).deep.equals({ result: PlaceValidationResult.MissingParent });
|
|
49
|
-
});
|
|
50
|
-
it('detects root places', () => {
|
|
51
|
-
expect(validateStablePlace(testTree.view, {
|
|
52
|
-
referenceSibling: testTree.identifier,
|
|
53
|
-
side: Side.Before,
|
|
54
|
-
})).deep.equals({ result: PlaceValidationResult.SiblingIsRootOrDetached });
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
describe('validateStableRange', () => {
|
|
58
|
-
it('accepts valid ranges', () => {
|
|
59
|
-
const validatedRange = validateStableRange(testTree.view, {
|
|
60
|
-
start: { referenceSibling: testTree.left.identifier, side: Side.Before },
|
|
61
|
-
end: { referenceSibling: testTree.left.identifier, side: Side.After },
|
|
62
|
-
});
|
|
63
|
-
expect(validatedRange.result).to.equal(RangeValidationResultKind.Valid);
|
|
64
|
-
if (validatedRange.result === RangeValidationResultKind.Valid) {
|
|
65
|
-
expect(validatedRange.start.referenceSibling).to.equal(testTree.left.identifier);
|
|
66
|
-
expect(validatedRange.start.referenceTrait).to.be.undefined;
|
|
67
|
-
expect(validatedRange.start.side).to.equal(Side.Before);
|
|
68
|
-
expect(validatedRange.end.referenceSibling).to.equal(testTree.left.identifier);
|
|
69
|
-
expect(validatedRange.end.referenceTrait).to.be.undefined;
|
|
70
|
-
expect(validatedRange.end.side).to.equal(Side.After);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
expect.fail();
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
it('detects inverted ranges', () => {
|
|
77
|
-
expect(validateStableRange(testTree.view, {
|
|
78
|
-
start: { referenceSibling: testTree.left.identifier, side: Side.After },
|
|
79
|
-
end: { referenceSibling: testTree.left.identifier, side: Side.Before },
|
|
80
|
-
})).deep.equals({ result: RangeValidationResultKind.Inverted });
|
|
81
|
-
});
|
|
82
|
-
it('detects when place are in different traits', () => {
|
|
83
|
-
expect(validateStableRange(testTree.view, {
|
|
84
|
-
start: { referenceSibling: testTree.left.identifier, side: Side.Before },
|
|
85
|
-
end: { referenceSibling: testTree.right.identifier, side: Side.After },
|
|
86
|
-
})).deep.equals({ result: RangeValidationResultKind.PlacesInDifferentTraits });
|
|
87
|
-
});
|
|
88
|
-
it('detects malformed places', () => {
|
|
89
|
-
const start = {
|
|
90
|
-
referenceTrait: testTree.left.traitLocation,
|
|
91
|
-
referenceSibling: testTree.left.identifier,
|
|
92
|
-
side: Side.Before,
|
|
93
|
-
};
|
|
94
|
-
expect(validateStableRange(testTree.view, {
|
|
95
|
-
// trait and sibling should be mutually exclusive
|
|
96
|
-
start,
|
|
97
|
-
end: { referenceSibling: testTree.left.identifier, side: Side.After },
|
|
98
|
-
})).deep.equals({
|
|
99
|
-
result: {
|
|
100
|
-
kind: RangeValidationResultKind.BadPlace,
|
|
101
|
-
place: start,
|
|
102
|
-
placeFailure: PlaceValidationResult.Malformed,
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
it('detects invalid places', () => {
|
|
107
|
-
const start = {
|
|
108
|
-
referenceSibling: testTree.generateNodeId(),
|
|
109
|
-
side: Side.Before,
|
|
110
|
-
};
|
|
111
|
-
expect(validateStableRange(testTree.view, {
|
|
112
|
-
start,
|
|
113
|
-
end: { referenceSibling: testTree.right.identifier, side: Side.After },
|
|
114
|
-
})).deep.equals({
|
|
115
|
-
result: {
|
|
116
|
-
kind: RangeValidationResultKind.BadPlace,
|
|
117
|
-
place: start,
|
|
118
|
-
placeFailure: PlaceValidationResult.MissingSibling,
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
describe('Tree node conversion', () => {
|
|
124
|
-
it('can clone a tree', () => {
|
|
125
|
-
const clone = convertTreeNodes(getChangeNodeFromView(testTree.view), (node) => ({
|
|
126
|
-
...node,
|
|
127
|
-
}));
|
|
128
|
-
expect(testTree).to.not.equal(clone);
|
|
129
|
-
expect(deepCompareNodes(testTree, clone)).to.be.true;
|
|
130
|
-
});
|
|
131
|
-
it('can clone a leaf', () => {
|
|
132
|
-
let converted = false;
|
|
133
|
-
expect(convertTreeNodes(42, (n) => {
|
|
134
|
-
converted = true;
|
|
135
|
-
return n;
|
|
136
|
-
}, isNumber)).to.equal(42);
|
|
137
|
-
expect(converted).to.be.false;
|
|
138
|
-
});
|
|
139
|
-
it('can clone a tree with a leaf', () => {
|
|
140
|
-
const leafTrait = 'main';
|
|
141
|
-
const leafId = testTree.generateNodeId();
|
|
142
|
-
const tree = {
|
|
143
|
-
...testTree.buildLeaf(testTree.generateNodeId()),
|
|
144
|
-
payload: 'payload',
|
|
145
|
-
traits: { [leafTrait]: [testTree.buildLeaf(leafId)] },
|
|
146
|
-
};
|
|
147
|
-
const clone = convertTreeNodes(tree, (node) => ({ ...node }));
|
|
148
|
-
assert(typeof clone !== 'number', 0x660 /* */);
|
|
149
|
-
expect(clone.definition).to.equal(tree.definition);
|
|
150
|
-
expect(clone.identifier).to.equal(tree.identifier);
|
|
151
|
-
expect(clone.payload).to.equal(tree.payload);
|
|
152
|
-
expect(clone.traits[leafTrait][0].identifier).to.equal(leafId);
|
|
153
|
-
});
|
|
154
|
-
it('correctly invokes the convert function', () => {
|
|
155
|
-
const node = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'payload' };
|
|
156
|
-
let converted = false;
|
|
157
|
-
convertTreeNodes(node, (n) => {
|
|
158
|
-
converted = true;
|
|
159
|
-
expect(node.definition).to.equal(node.definition);
|
|
160
|
-
expect(node.identifier).to.equal(node.identifier);
|
|
161
|
-
expect(node.payload).to.equal(node.payload);
|
|
162
|
-
return n;
|
|
163
|
-
}, isNumber);
|
|
164
|
-
expect(converted).to.be.true;
|
|
165
|
-
});
|
|
166
|
-
it('can convert a node', () => {
|
|
167
|
-
const node = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'payload' };
|
|
168
|
-
const id = testTree.generateNodeId();
|
|
169
|
-
const converted = convertTreeNodes(node, (_) => ({ definition: '_def', identifier: id, payload: 'payload2' }), isNumber);
|
|
170
|
-
expect(converted).to.deep.equal({ definition: '_def', identifier: id, payload: 'payload2', traits: {} });
|
|
171
|
-
});
|
|
172
|
-
it('creates empty trait objects for the root', () => {
|
|
173
|
-
const node = { ...testTree.buildLeaf(testTree.generateNodeId()) };
|
|
174
|
-
const converted = convertTreeNodes(node, (n) => internalizeBuildNode(n, testTree), isNumber);
|
|
175
|
-
assert(typeof converted !== 'number', 0x661 /* unexpected detached ID */);
|
|
176
|
-
expect(converted.traits).to.not.be.undefined;
|
|
177
|
-
});
|
|
178
|
-
it('creates empty trait objects for children', () => {
|
|
179
|
-
const node = { ...testTree.buildLeaf(), traits: { main: { ...testTree.buildLeaf() } } };
|
|
180
|
-
const converted = convertTreeNodes(node, (n) => internalizeBuildNode(n, testTree), isNumber);
|
|
181
|
-
assert(typeof converted !== 'number', 0x662 /* unexpected detached ID */);
|
|
182
|
-
expect(converted.traits).to.not.be.undefined;
|
|
183
|
-
});
|
|
184
|
-
it('can convert a tree with children', () => {
|
|
185
|
-
const childA = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'a' };
|
|
186
|
-
const childB = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'b' };
|
|
187
|
-
const node = { ...testTree.buildLeaf(testTree.generateNodeId()), traits: { main: [childA, childB] } };
|
|
188
|
-
const converted = convertTreeNodes(node, (node) => {
|
|
189
|
-
if (node.identifier === childB.identifier) {
|
|
190
|
-
return { definition: node.definition, identifier: node.identifier, payload: 'c' };
|
|
191
|
-
}
|
|
192
|
-
return node;
|
|
193
|
-
});
|
|
194
|
-
expect(converted).to.deep.equal({
|
|
195
|
-
definition: node.definition,
|
|
196
|
-
identifier: node.identifier,
|
|
197
|
-
traits: {
|
|
198
|
-
main: [
|
|
199
|
-
{ definition: childA.definition, identifier: childA.identifier, payload: 'a', traits: {} },
|
|
200
|
-
{ definition: childB.definition, identifier: childB.identifier, payload: 'c', traits: {} },
|
|
201
|
-
],
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
it('can convert a tree with a grandchild', () => {
|
|
206
|
-
const grandchild = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'g' };
|
|
207
|
-
const child = { ...testTree.buildLeaf(testTree.generateNodeId()), traits: { main: [grandchild] } };
|
|
208
|
-
const parent = { ...testTree.buildLeaf(testTree.generateNodeId()), traits: { main: [child] } };
|
|
209
|
-
const converted = convertTreeNodes(parent, (node) => {
|
|
210
|
-
if (node.identifier === grandchild.identifier) {
|
|
211
|
-
return { definition: node.definition, identifier: node.identifier, payload: 'h' };
|
|
212
|
-
}
|
|
213
|
-
return node;
|
|
214
|
-
});
|
|
215
|
-
expect(converted).to.deep.equal({
|
|
216
|
-
definition: parent.definition,
|
|
217
|
-
identifier: parent.identifier,
|
|
218
|
-
traits: {
|
|
219
|
-
main: [
|
|
220
|
-
{
|
|
221
|
-
definition: child.definition,
|
|
222
|
-
identifier: child.identifier,
|
|
223
|
-
traits: {
|
|
224
|
-
main: [
|
|
225
|
-
{
|
|
226
|
-
definition: grandchild.definition,
|
|
227
|
-
identifier: grandchild.identifier,
|
|
228
|
-
payload: 'h',
|
|
229
|
-
traits: {},
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
},
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
it('walks trees in a consistent order', () => {
|
|
239
|
-
// Construct two trees that are the same but have their traits defined in different orders
|
|
240
|
-
const buildTreeA = {
|
|
241
|
-
definition: 'parent',
|
|
242
|
-
traits: {
|
|
243
|
-
left: {
|
|
244
|
-
definition: 'left child',
|
|
245
|
-
traits: {
|
|
246
|
-
left: {
|
|
247
|
-
definition: 'left grandchild under left',
|
|
248
|
-
},
|
|
249
|
-
right: {
|
|
250
|
-
definition: 'right grandchild under left',
|
|
251
|
-
},
|
|
252
|
-
main: [
|
|
253
|
-
{ definition: 'grandchild A under left main' },
|
|
254
|
-
{ definition: 'grandchild B under left main' },
|
|
255
|
-
{ definition: 'grandchild C under left main' },
|
|
256
|
-
],
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
right: {
|
|
260
|
-
definition: 'right child',
|
|
261
|
-
traits: {
|
|
262
|
-
left: {
|
|
263
|
-
definition: 'left grandchild under right',
|
|
264
|
-
},
|
|
265
|
-
right: {
|
|
266
|
-
definition: 'right grandchild under right',
|
|
267
|
-
},
|
|
268
|
-
main: [
|
|
269
|
-
{ definition: 'grandchild A under right main' },
|
|
270
|
-
{ definition: 'grandchild B under right main' },
|
|
271
|
-
{ definition: 'grandchild C under right main' },
|
|
272
|
-
],
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
main: [
|
|
276
|
-
{ definition: 'child A under main' },
|
|
277
|
-
{ definition: 'child B under main' },
|
|
278
|
-
{ definition: 'child C under main' },
|
|
279
|
-
],
|
|
280
|
-
},
|
|
281
|
-
};
|
|
282
|
-
const buildTreeB = {
|
|
283
|
-
definition: 'parent',
|
|
284
|
-
traits: {
|
|
285
|
-
right: {
|
|
286
|
-
definition: 'right child',
|
|
287
|
-
traits: {
|
|
288
|
-
left: {
|
|
289
|
-
definition: 'left grandchild under right',
|
|
290
|
-
},
|
|
291
|
-
main: [
|
|
292
|
-
{ definition: 'grandchild A under right main' },
|
|
293
|
-
{ definition: 'grandchild B under right main' },
|
|
294
|
-
{ definition: 'grandchild C under right main' },
|
|
295
|
-
],
|
|
296
|
-
right: {
|
|
297
|
-
definition: 'right grandchild under right',
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
main: [
|
|
302
|
-
{ definition: 'child A under main' },
|
|
303
|
-
{ definition: 'child B under main' },
|
|
304
|
-
{ definition: 'child C under main' },
|
|
305
|
-
],
|
|
306
|
-
left: {
|
|
307
|
-
definition: 'left child',
|
|
308
|
-
traits: {
|
|
309
|
-
main: [
|
|
310
|
-
{ definition: 'grandchild A under left main' },
|
|
311
|
-
{ definition: 'grandchild B under left main' },
|
|
312
|
-
{ definition: 'grandchild C under left main' },
|
|
313
|
-
],
|
|
314
|
-
right: {
|
|
315
|
-
definition: 'right grandchild under left',
|
|
316
|
-
},
|
|
317
|
-
left: {
|
|
318
|
-
definition: 'left grandchild under left',
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
};
|
|
324
|
-
// Record the order in which the tree walk visits each node in each tree
|
|
325
|
-
const definitionsA = [];
|
|
326
|
-
walkTree(buildTreeA, (n) => definitionsA.push(n.definition), (x) => typeof x === 'number');
|
|
327
|
-
const definitionsB = [];
|
|
328
|
-
walkTree(buildTreeB, (n) => definitionsB.push(n.definition), (x) => typeof x === 'number');
|
|
329
|
-
// The orders should be the same, even though the trees had their traits defined in different orders
|
|
330
|
-
expect(definitionsA).to.deep.equal(definitionsB);
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
describe('Build tree internalization', () => {
|
|
334
|
-
it('does not copy extraneous properties from input tree', () => {
|
|
335
|
-
const node = {
|
|
336
|
-
...testTree.buildLeaf(testTree.generateNodeId()),
|
|
337
|
-
traits: { main: [testTree.buildLeaf(testTree.generateNodeId())] },
|
|
338
|
-
};
|
|
339
|
-
node.extra = 'This is extra data that should not be copied';
|
|
340
|
-
const converted = convertTreeNodes(node, (node) => internalizeBuildNode(node, testTree), isNumber);
|
|
341
|
-
expect(converted).to.deep.equal({
|
|
342
|
-
definition: node.definition,
|
|
343
|
-
identifier: node.identifier,
|
|
344
|
-
traits: node.traits,
|
|
345
|
-
});
|
|
346
|
-
});
|
|
347
|
-
it('does not copy extraneous properties from converter', () => {
|
|
348
|
-
const node = testTree.buildLeaf(testTree.generateNodeId());
|
|
349
|
-
expect(Object.prototype.hasOwnProperty.call(node, 'payload')).to.be.false;
|
|
350
|
-
const converted = convertTreeNodes(node, (node) => internalizeBuildNode(node, testTree), isNumber);
|
|
351
|
-
expect(Object.prototype.hasOwnProperty.call(converted, 'payload')).to.be.false;
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
function isNumber(node) {
|
|
355
|
-
return typeof node === 'number';
|
|
356
|
-
}
|
|
357
|
-
describe('comparePayloads', () => {
|
|
358
|
-
const serializer = new FluidSerializer(new MockFluidDataStoreRuntime().IFluidHandleContext, () => { });
|
|
359
|
-
const binder = { bind: noop };
|
|
360
|
-
let Equality;
|
|
361
|
-
(function (Equality) {
|
|
362
|
-
Equality[Equality["Equal"] = 0] = "Equal";
|
|
363
|
-
Equality[Equality["Unequal"] = 1] = "Unequal";
|
|
364
|
-
Equality[Equality["Unspecified"] = 2] = "Unspecified";
|
|
365
|
-
})(Equality || (Equality = {}));
|
|
366
|
-
function checkEquality(equal, equality) {
|
|
367
|
-
if (equality !== Equality.Unspecified) {
|
|
368
|
-
expect(equal).equals(equality === Equality.Equal);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
function check(a, b, flags) {
|
|
372
|
-
// Check reflexive
|
|
373
|
-
expect(comparePayloads(a, a)).equal(true);
|
|
374
|
-
expect(comparePayloads(b, b)).equal(true);
|
|
375
|
-
checkEquality(comparePayloads(a, b), flags.initial);
|
|
376
|
-
// Check commutative
|
|
377
|
-
checkEquality(comparePayloads(b, a), flags.initial);
|
|
378
|
-
const [aString, aDeserialized] = checkSerialization(a, flags.roundtrip);
|
|
379
|
-
const [bString, bDeserialized] = checkSerialization(b, flags.roundtrip);
|
|
380
|
-
checkEquality(aString === bString, flags.serialized);
|
|
381
|
-
checkEquality(comparePayloads(aDeserialized, bDeserialized), flags.deserialized);
|
|
382
|
-
// Check commutative
|
|
383
|
-
checkEquality(comparePayloads(bDeserialized, aDeserialized), flags.deserialized);
|
|
384
|
-
}
|
|
385
|
-
function checkSerialization(a, roundtrip) {
|
|
386
|
-
const aString = serializer.stringify(a, binder);
|
|
387
|
-
const a2 = serializer.parse(aString);
|
|
388
|
-
const aString2 = serializer.stringify(a2, binder);
|
|
389
|
-
expect(aString2).equal(aString);
|
|
390
|
-
checkEquality(comparePayloads(a, a2), roundtrip);
|
|
391
|
-
// Check second round trip, should always be equal
|
|
392
|
-
const a3 = serializer.parse(aString2);
|
|
393
|
-
expect(comparePayloads(a3, a2)).true;
|
|
394
|
-
return [aString, a2];
|
|
395
|
-
}
|
|
396
|
-
const allEqual = {
|
|
397
|
-
initial: Equality.Equal,
|
|
398
|
-
serialized: Equality.Equal,
|
|
399
|
-
deserialized: Equality.Equal,
|
|
400
|
-
roundtrip: Equality.Equal,
|
|
401
|
-
};
|
|
402
|
-
// For when the inputs are logically equal, but may serialize differently due to field ordering.
|
|
403
|
-
const allEqualUnstable = {
|
|
404
|
-
initial: Equality.Equal,
|
|
405
|
-
serialized: Equality.Unspecified,
|
|
406
|
-
deserialized: Equality.Equal,
|
|
407
|
-
roundtrip: Equality.Equal,
|
|
408
|
-
};
|
|
409
|
-
const allUnequal = {
|
|
410
|
-
initial: Equality.Unequal,
|
|
411
|
-
serialized: Equality.Unequal,
|
|
412
|
-
deserialized: Equality.Unequal,
|
|
413
|
-
roundtrip: Equality.Equal,
|
|
414
|
-
};
|
|
415
|
-
it('compares numbers correctly', () => {
|
|
416
|
-
check(0, 0, allEqual);
|
|
417
|
-
check(1, 1, allEqual);
|
|
418
|
-
check(0, 1, allUnequal);
|
|
419
|
-
check(-1, 1, allUnequal);
|
|
420
|
-
check(5.2, 5.200000001, allUnequal);
|
|
421
|
-
});
|
|
422
|
-
it('compares strings', () => {
|
|
423
|
-
check('', '', allEqual);
|
|
424
|
-
check(' ', '', allUnequal);
|
|
425
|
-
check('1', '+1', allUnequal);
|
|
426
|
-
// This character makes sure multi-byte utf-8 and multi-word utf-16 at least somewhat work
|
|
427
|
-
// Cases like unicode normalization are not covered here here. Normalization or not will be considered ok.
|
|
428
|
-
check('𤭢', '𤭢', allEqual);
|
|
429
|
-
check('𤭢', '', allUnequal);
|
|
430
|
-
check('several characters', 'several characters', allEqual);
|
|
431
|
-
check('several characters', 'several_characters', allUnequal);
|
|
432
|
-
});
|
|
433
|
-
it('compares arrays', () => {
|
|
434
|
-
check([], [], allEqual);
|
|
435
|
-
check([1], [1], allEqual);
|
|
436
|
-
check([[1]], [[1]], allEqual);
|
|
437
|
-
check([[1]], [[2]], allUnequal);
|
|
438
|
-
check([], [1], allUnequal);
|
|
439
|
-
check([1, 2], [2, 1], allUnequal);
|
|
440
|
-
});
|
|
441
|
-
it('compares objects', () => {
|
|
442
|
-
check({ 1: 'x' }, { 1: 'x' }, allEqual);
|
|
443
|
-
check({ x: 'x' }, { y: 'x' }, allUnequal);
|
|
444
|
-
check({ x: 'x' }, { x: {} }, allUnequal);
|
|
445
|
-
check({ x: {} }, { x: {} }, allEqual);
|
|
446
|
-
check({ x: [1, 2, 3, 5] }, { x: [1, 2, 3, 4] }, allUnequal);
|
|
447
|
-
check({ 1: 'x' }, {}, allUnequal);
|
|
448
|
-
check({ x: 'x' }, { x: 'x', y: 'x' }, allUnequal);
|
|
449
|
-
check({ field: 'a' }, { field: 'b' }, allUnequal);
|
|
450
|
-
// Fluid Serialization arbitrarily orders fields.
|
|
451
|
-
// Thus any object with more than one field may have non-deterministic serialization.
|
|
452
|
-
// However objects have field order, and we need to check comparePayloads is not impacted by it.
|
|
453
|
-
check({ y: 'a', x: 'b' }, { x: 'b', y: 'a' }, allEqualUnstable);
|
|
454
|
-
});
|
|
455
|
-
it('compares mixed types', () => {
|
|
456
|
-
check({ 0: 1 }, [1], allUnequal);
|
|
457
|
-
// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface)
|
|
458
|
-
check(null, 'null', allUnequal);
|
|
459
|
-
check(null, 'null', allUnequal);
|
|
460
|
-
check(1, '1', allUnequal);
|
|
461
|
-
check(null, 0, allUnequal);
|
|
462
|
-
check('', 0, allUnequal);
|
|
463
|
-
});
|
|
464
|
-
const sameAfter = {
|
|
465
|
-
initial: Equality.Unspecified,
|
|
466
|
-
serialized: Equality.Unspecified,
|
|
467
|
-
deserialized: Equality.Equal,
|
|
468
|
-
roundtrip: Equality.Unspecified,
|
|
469
|
-
};
|
|
470
|
-
const differentAfter = {
|
|
471
|
-
initial: Equality.Unequal,
|
|
472
|
-
serialized: Equality.Unequal,
|
|
473
|
-
deserialized: Equality.Unequal,
|
|
474
|
-
roundtrip: Equality.Unspecified,
|
|
475
|
-
};
|
|
476
|
-
it('lossy cases', () => {
|
|
477
|
-
// Undefined fields are omitted in json, and thus lost on the round trip.
|
|
478
|
-
check({ x: undefined }, { y: undefined }, sameAfter);
|
|
479
|
-
check({ x: undefined }, {}, sameAfter);
|
|
480
|
-
// NaN and Infinity become null
|
|
481
|
-
check(NaN, NaN, sameAfter);
|
|
482
|
-
check(NaN, 7, differentAfter);
|
|
483
|
-
check(Infinity, Infinity, sameAfter);
|
|
484
|
-
check(-Infinity, Infinity, sameAfter);
|
|
485
|
-
check(NaN, 'NaN', differentAfter);
|
|
486
|
-
// json loses -0 on round trip
|
|
487
|
-
check(-0, -0, sameAfter);
|
|
488
|
-
});
|
|
489
|
-
it('compares handles', () => {
|
|
490
|
-
// This is used instead of MockHandle so equal handles compare deeply equal.
|
|
491
|
-
function makeMockHandle(data) {
|
|
492
|
-
// `/` prefix is needed to prevent serializing from modifying handle.
|
|
493
|
-
const handleObject = { absolutePath: `/${data}`, IFluidHandle: undefined };
|
|
494
|
-
handleObject.IFluidHandle = handleObject;
|
|
495
|
-
return handleObject;
|
|
496
|
-
}
|
|
497
|
-
// Theoretically handles serialize as objects with 2 fields and thus serialization is allowed to be non-deterministic
|
|
498
|
-
// so use allEqualUnstable not allEqual.
|
|
499
|
-
check(makeMockHandle('x'), makeMockHandle('x'), allEqualUnstable);
|
|
500
|
-
check(makeMockHandle('x'), makeMockHandle('y'), allUnequal);
|
|
501
|
-
check({ x: makeMockHandle('x') }, makeMockHandle('x'), allUnequal);
|
|
502
|
-
});
|
|
503
|
-
// These are cases that are allowed by the type system and produce unexpected results due to Json serialization.
|
|
504
|
-
// Clear documentation and/or adjustments to equality, type checking or serialization would help with these cases.
|
|
505
|
-
it.skip('strange cases', () => {
|
|
506
|
-
// Top level undefined fails in JSON.parse.
|
|
507
|
-
// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface.)
|
|
508
|
-
check(undefined, null, sameAfter);
|
|
509
|
-
});
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
//# sourceMappingURL=EditUtilities.tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditUtilities.tests.js","sourceRoot":"","sources":["../../src/test/EditUtilities.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA0C,IAAI,EAAY,MAAM,6BAA6B,CAAC;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,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kBAAkB,EAAE,GAAG,EAAE;YAC3B,4EAA4E;YAC5E,SAAS,cAAc,CAAC,IAAY;gBACnC,qEAAqE;gBACrE,MAAM,YAAY,GAAG,EAAE,YAAY,EAAE,IAAI,IAAI,EAAE,EAAE,YAAY,EAAE,SAAoB,EAAE,CAAC;gBACtF,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;gBACzC,OAAO,YAA4B,CAAC;YACrC,CAAC;YACD,qHAAqH;YACrH,wCAAwC;YACxC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,CAAC;YAClE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;YAC5D,KAAK,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,gHAAgH;QAChH,kHAAkH;QAClH,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;YAC7B,2CAA2C;YAC3C,gFAAgF;YAChF,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\nimport { assert } from '@fluidframework/core-utils';\nimport { IFluidHandle } from '@fluidframework/core-interfaces';\nimport { MockFluidDataStoreRuntime } from '@fluidframework/test-runtime-utils';\nimport { FluidSerializer } from '@fluidframework/shared-object-base';\nimport { Definition, NodeId } from '../Identifiers.js';\nimport { getChangeNodeFromView } from '../SerializationUtilities.js';\nimport { noop } from '../Common.js';\nimport {\n\tconvertTreeNodes,\n\tdeepCompareNodes,\n\tinternalizeBuildNode,\n\tPlaceValidationResult,\n\tRangeValidationResultKind,\n\tvalidateStablePlace,\n\tvalidateStableRange,\n\twalkTree,\n} from '../EditUtilities.js';\nimport { BuildNodeInternal, ChangeNode, Payload, Side, TreeNode } from '../persisted-types/index.js';\nimport { BuildNode, BuildTreeNode } from '../ChangeTypes.js';\nimport { comparePayloads } from '../PayloadUtilities.js';\nimport { refreshTestTree } from './utilities/TestUtilities.js';\n\ndescribe('EditUtilities', () => {\n\tconst testTree = refreshTestTree(undefined, undefined, /* expensiveValidation: */ true);\n\n\tdescribe('validateStablePlace', () => {\n\t\tit('accepts valid places', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStablePlace(testTree.view, {\n\t\t\t\t\treferenceSibling: testTree.left.identifier,\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t})\n\t\t\t).deep.equals({\n\t\t\t\tresult: PlaceValidationResult.Valid,\n\t\t\t\treferenceSibling: testTree.left.identifier,\n\t\t\t\tside: Side.Before,\n\t\t\t});\n\t\t});\n\n\t\tit('detects malformed places', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStablePlace(testTree.view, {\n\t\t\t\t\treferenceTrait: testTree.left.traitLocation,\n\t\t\t\t\treferenceSibling: testTree.left.identifier,\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t})\n\t\t\t).deep.equals({ result: PlaceValidationResult.Malformed });\n\t\t});\n\n\t\tit('detects missing siblings', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStablePlace(testTree.view, {\n\t\t\t\t\treferenceSibling: testTree.generateNodeId(),\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t})\n\t\t\t).deep.equals({ result: PlaceValidationResult.MissingSibling });\n\t\t});\n\n\t\tit('detects missing parents', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStablePlace(testTree.view, {\n\t\t\t\t\treferenceTrait: {\n\t\t\t\t\t\tparent: testTree.generateNodeId(),\n\t\t\t\t\t\tlabel: testTree.left.traitLabel,\n\t\t\t\t\t},\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t})\n\t\t\t).deep.equals({ result: PlaceValidationResult.MissingParent });\n\t\t});\n\n\t\tit('detects root places', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStablePlace(testTree.view, {\n\t\t\t\t\treferenceSibling: testTree.identifier,\n\t\t\t\t\tside: Side.Before,\n\t\t\t\t})\n\t\t\t).deep.equals({ result: PlaceValidationResult.SiblingIsRootOrDetached });\n\t\t});\n\t});\n\n\tdescribe('validateStableRange', () => {\n\t\tit('accepts valid ranges', () => {\n\t\t\tconst validatedRange = validateStableRange(testTree.view, {\n\t\t\t\tstart: { referenceSibling: testTree.left.identifier, side: Side.Before },\n\t\t\t\tend: { referenceSibling: testTree.left.identifier, side: Side.After },\n\t\t\t});\n\t\t\texpect(validatedRange.result).to.equal(RangeValidationResultKind.Valid);\n\t\t\tif (validatedRange.result === RangeValidationResultKind.Valid) {\n\t\t\t\texpect(validatedRange.start.referenceSibling).to.equal(testTree.left.identifier);\n\t\t\t\texpect(validatedRange.start.referenceTrait).to.be.undefined;\n\t\t\t\texpect(validatedRange.start.side).to.equal(Side.Before);\n\t\t\t\texpect(validatedRange.end.referenceSibling).to.equal(testTree.left.identifier);\n\t\t\t\texpect(validatedRange.end.referenceTrait).to.be.undefined;\n\t\t\t\texpect(validatedRange.end.side).to.equal(Side.After);\n\t\t\t} else {\n\t\t\t\texpect.fail();\n\t\t\t}\n\t\t});\n\n\t\tit('detects inverted ranges', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStableRange(testTree.view, {\n\t\t\t\t\tstart: { referenceSibling: testTree.left.identifier, side: Side.After },\n\t\t\t\t\tend: { referenceSibling: testTree.left.identifier, side: Side.Before },\n\t\t\t\t})\n\t\t\t).deep.equals({ result: RangeValidationResultKind.Inverted });\n\t\t});\n\n\t\tit('detects when place are in different traits', () => {\n\t\t\texpect(\n\t\t\t\tvalidateStableRange(testTree.view, {\n\t\t\t\t\tstart: { referenceSibling: testTree.left.identifier, side: Side.Before },\n\t\t\t\t\tend: { referenceSibling: testTree.right.identifier, side: Side.After },\n\t\t\t\t})\n\t\t\t).deep.equals({ result: RangeValidationResultKind.PlacesInDifferentTraits });\n\t\t});\n\n\t\tit('detects malformed places', () => {\n\t\t\tconst start = {\n\t\t\t\treferenceTrait: testTree.left.traitLocation,\n\t\t\t\treferenceSibling: testTree.left.identifier,\n\t\t\t\tside: Side.Before,\n\t\t\t};\n\t\t\texpect(\n\t\t\t\tvalidateStableRange(testTree.view, {\n\t\t\t\t\t// trait and sibling should be mutually exclusive\n\t\t\t\t\tstart,\n\t\t\t\t\tend: { referenceSibling: testTree.left.identifier, side: Side.After },\n\t\t\t\t})\n\t\t\t).deep.equals({\n\t\t\t\tresult: {\n\t\t\t\t\tkind: RangeValidationResultKind.BadPlace,\n\t\t\t\t\tplace: start,\n\t\t\t\t\tplaceFailure: PlaceValidationResult.Malformed,\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\n\t\tit('detects invalid places', () => {\n\t\t\tconst start = {\n\t\t\t\treferenceSibling: testTree.generateNodeId(),\n\t\t\t\tside: Side.Before,\n\t\t\t};\n\t\t\texpect(\n\t\t\t\tvalidateStableRange(testTree.view, {\n\t\t\t\t\tstart,\n\t\t\t\t\tend: { referenceSibling: testTree.right.identifier, side: Side.After },\n\t\t\t\t})\n\t\t\t).deep.equals({\n\t\t\t\tresult: {\n\t\t\t\t\tkind: RangeValidationResultKind.BadPlace,\n\t\t\t\t\tplace: start,\n\t\t\t\t\tplaceFailure: PlaceValidationResult.MissingSibling,\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe('Tree node conversion', () => {\n\t\tit('can clone a tree', () => {\n\t\t\tconst clone = convertTreeNodes<ChangeNode, ChangeNode>(getChangeNodeFromView(testTree.view), (node) => ({\n\t\t\t\t...node,\n\t\t\t}));\n\t\t\texpect(testTree).to.not.equal(clone);\n\t\t\texpect(deepCompareNodes(testTree, clone)).to.be.true;\n\t\t});\n\n\t\tit('can clone a leaf', () => {\n\t\t\tlet converted = false;\n\t\t\texpect(\n\t\t\t\tconvertTreeNodes(\n\t\t\t\t\t42,\n\t\t\t\t\t(n) => {\n\t\t\t\t\t\tconverted = true;\n\t\t\t\t\t\treturn n;\n\t\t\t\t\t},\n\t\t\t\t\tisNumber\n\t\t\t\t)\n\t\t\t).to.equal(42);\n\t\t\texpect(converted).to.be.false;\n\t\t});\n\n\t\tit('can clone a tree with a leaf', () => {\n\t\t\tconst leafTrait = 'main';\n\t\t\tconst leafId = testTree.generateNodeId();\n\t\t\tconst tree = {\n\t\t\t\t...testTree.buildLeaf(testTree.generateNodeId()),\n\t\t\t\tpayload: 'payload',\n\t\t\t\ttraits: { [leafTrait]: [testTree.buildLeaf(leafId)] },\n\t\t\t};\n\t\t\tconst clone = convertTreeNodes<ChangeNode, ChangeNode>(tree, (node) => ({ ...node }));\n\t\t\tassert(typeof clone !== 'number', 0x660 /* */);\n\t\t\texpect(clone.definition).to.equal(tree.definition);\n\t\t\texpect(clone.identifier).to.equal(tree.identifier);\n\t\t\texpect(clone.payload).to.equal(tree.payload);\n\t\t\texpect(clone.traits[leafTrait][0].identifier).to.equal(leafId);\n\t\t});\n\n\t\tit('correctly invokes the convert function', () => {\n\t\t\tconst node = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'payload' };\n\t\t\tlet converted = false;\n\t\t\tconvertTreeNodes(\n\t\t\t\tnode,\n\t\t\t\t(n) => {\n\t\t\t\t\tconverted = true;\n\t\t\t\t\texpect(node.definition).to.equal(node.definition);\n\t\t\t\t\texpect(node.identifier).to.equal(node.identifier);\n\t\t\t\t\texpect(node.payload).to.equal(node.payload);\n\t\t\t\t\treturn n;\n\t\t\t\t},\n\t\t\t\tisNumber\n\t\t\t);\n\t\t\texpect(converted).to.be.true;\n\t\t});\n\n\t\tit('can convert a node', () => {\n\t\t\tconst node = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'payload' };\n\t\t\tconst id = testTree.generateNodeId();\n\t\t\tconst converted = convertTreeNodes(\n\t\t\t\tnode,\n\t\t\t\t(_) => ({ definition: '_def' as Definition, identifier: id, payload: 'payload2' }),\n\t\t\t\tisNumber\n\t\t\t);\n\t\t\texpect(converted).to.deep.equal({ definition: '_def', identifier: id, payload: 'payload2', traits: {} });\n\t\t});\n\n\t\tit('creates empty trait objects for the root', () => {\n\t\t\tconst node: BuildTreeNode = { ...testTree.buildLeaf(testTree.generateNodeId()) };\n\t\t\tconst converted = convertTreeNodes<BuildTreeNode, TreeNode<BuildNodeInternal, NodeId>, number>(\n\t\t\t\tnode,\n\t\t\t\t(n) => internalizeBuildNode(n, testTree),\n\t\t\t\tisNumber\n\t\t\t);\n\t\t\tassert(typeof converted !== 'number', 0x661 /* unexpected detached ID */);\n\t\t\texpect(converted.traits).to.not.be.undefined;\n\t\t});\n\n\t\tit('creates empty trait objects for children', () => {\n\t\t\tconst node: BuildNode = { ...testTree.buildLeaf(), traits: { main: { ...testTree.buildLeaf() } } };\n\t\t\tconst converted = convertTreeNodes<BuildTreeNode, TreeNode<BuildNodeInternal, NodeId>, number>(\n\t\t\t\tnode,\n\t\t\t\t(n) => internalizeBuildNode(n, testTree),\n\t\t\t\tisNumber\n\t\t\t);\n\t\t\tassert(typeof converted !== 'number', 0x662 /* unexpected detached ID */);\n\t\t\texpect(converted.traits).to.not.be.undefined;\n\t\t});\n\n\t\tit('can convert a tree with children', () => {\n\t\t\tconst childA = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'a' };\n\t\t\tconst childB = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'b' };\n\t\t\tconst node = { ...testTree.buildLeaf(testTree.generateNodeId()), traits: { main: [childA, childB] } };\n\t\t\tconst converted = convertTreeNodes<ChangeNode, ChangeNode>(node, (node) => {\n\t\t\t\tif (node.identifier === childB.identifier) {\n\t\t\t\t\treturn { definition: node.definition, identifier: node.identifier, payload: 'c' };\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t});\n\t\t\texpect(converted).to.deep.equal({\n\t\t\t\tdefinition: node.definition,\n\t\t\t\tidentifier: node.identifier,\n\t\t\t\ttraits: {\n\t\t\t\t\tmain: [\n\t\t\t\t\t\t{ definition: childA.definition, identifier: childA.identifier, payload: 'a', traits: {} },\n\t\t\t\t\t\t{ definition: childB.definition, identifier: childB.identifier, payload: 'c', traits: {} },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\n\t\tit('can convert a tree with a grandchild', () => {\n\t\t\tconst grandchild = { ...testTree.buildLeaf(testTree.generateNodeId()), payload: 'g' };\n\t\t\tconst child = { ...testTree.buildLeaf(testTree.generateNodeId()), traits: { main: [grandchild] } };\n\t\t\tconst parent = { ...testTree.buildLeaf(testTree.generateNodeId()), traits: { main: [child] } };\n\t\t\tconst converted = convertTreeNodes<ChangeNode, ChangeNode>(parent, (node) => {\n\t\t\t\tif (node.identifier === grandchild.identifier) {\n\t\t\t\t\treturn { definition: node.definition, identifier: node.identifier, payload: 'h' };\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t});\n\t\t\texpect(converted).to.deep.equal({\n\t\t\t\tdefinition: parent.definition,\n\t\t\t\tidentifier: parent.identifier,\n\t\t\t\ttraits: {\n\t\t\t\t\tmain: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdefinition: child.definition,\n\t\t\t\t\t\t\tidentifier: child.identifier,\n\t\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\t\tmain: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdefinition: grandchild.definition,\n\t\t\t\t\t\t\t\t\t\tidentifier: grandchild.identifier,\n\t\t\t\t\t\t\t\t\t\tpayload: 'h',\n\t\t\t\t\t\t\t\t\t\ttraits: {},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\n\t\tit('walks trees in a consistent order', () => {\n\t\t\t// Construct two trees that are the same but have their traits defined in different orders\n\t\t\tconst buildTreeA: BuildTreeNode = {\n\t\t\t\tdefinition: 'parent',\n\t\t\t\ttraits: {\n\t\t\t\t\tleft: {\n\t\t\t\t\t\tdefinition: 'left child',\n\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\tdefinition: 'left grandchild under left',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\t\tdefinition: 'right grandchild under left',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmain: [\n\t\t\t\t\t\t\t\t{ definition: 'grandchild A under left main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild B under left main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild C under left main' },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tright: {\n\t\t\t\t\t\tdefinition: 'right child',\n\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\tdefinition: 'left grandchild under right',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\t\tdefinition: 'right grandchild under right',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmain: [\n\t\t\t\t\t\t\t\t{ definition: 'grandchild A under right main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild B under right main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild C under right main' },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tmain: [\n\t\t\t\t\t\t{ definition: 'child A under main' },\n\t\t\t\t\t\t{ definition: 'child B under main' },\n\t\t\t\t\t\t{ definition: 'child C under main' },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst buildTreeB: BuildTreeNode = {\n\t\t\t\tdefinition: 'parent',\n\t\t\t\ttraits: {\n\t\t\t\t\tright: {\n\t\t\t\t\t\tdefinition: 'right child',\n\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\tdefinition: 'left grandchild under right',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmain: [\n\t\t\t\t\t\t\t\t{ definition: 'grandchild A under right main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild B under right main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild C under right main' },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\t\tdefinition: 'right grandchild under right',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tmain: [\n\t\t\t\t\t\t{ definition: 'child A under main' },\n\t\t\t\t\t\t{ definition: 'child B under main' },\n\t\t\t\t\t\t{ definition: 'child C under main' },\n\t\t\t\t\t],\n\t\t\t\t\tleft: {\n\t\t\t\t\t\tdefinition: 'left child',\n\t\t\t\t\t\ttraits: {\n\t\t\t\t\t\t\tmain: [\n\t\t\t\t\t\t\t\t{ definition: 'grandchild A under left main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild B under left main' },\n\t\t\t\t\t\t\t\t{ definition: 'grandchild C under left main' },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tright: {\n\t\t\t\t\t\t\t\tdefinition: 'right grandchild under left',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\tdefinition: 'left grandchild under left',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\n\t\t\t// Record the order in which the tree walk visits each node in each tree\n\t\t\tconst definitionsA: string[] = [];\n\t\t\twalkTree<BuildTreeNode, number>(\n\t\t\t\tbuildTreeA,\n\t\t\t\t(n) => definitionsA.push(n.definition),\n\t\t\t\t(x): x is number => typeof x === 'number'\n\t\t\t);\n\n\t\t\tconst definitionsB: string[] = [];\n\t\t\twalkTree<BuildTreeNode, number>(\n\t\t\t\tbuildTreeB,\n\t\t\t\t(n) => definitionsB.push(n.definition),\n\t\t\t\t(x): x is number => typeof x === 'number'\n\t\t\t);\n\n\t\t\t// The orders should be the same, even though the trees had their traits defined in different orders\n\t\t\texpect(definitionsA).to.deep.equal(definitionsB);\n\t\t});\n\t});\n\n\tdescribe('Build tree internalization', () => {\n\t\tit('does not copy extraneous properties from input tree', () => {\n\t\t\tconst node: BuildTreeNode = {\n\t\t\t\t...testTree.buildLeaf(testTree.generateNodeId()),\n\t\t\t\ttraits: { main: [testTree.buildLeaf(testTree.generateNodeId())] },\n\t\t\t};\n\t\t\t(node as unknown as { extra: string }).extra = 'This is extra data that should not be copied';\n\t\t\tconst converted = convertTreeNodes<BuildTreeNode, TreeNode<BuildNodeInternal, NodeId>, number>(\n\t\t\t\tnode,\n\t\t\t\t(node) => internalizeBuildNode(node, testTree),\n\t\t\t\tisNumber\n\t\t\t);\n\t\t\texpect(converted).to.deep.equal({\n\t\t\t\tdefinition: node.definition,\n\t\t\t\tidentifier: node.identifier,\n\t\t\t\ttraits: node.traits,\n\t\t\t});\n\t\t});\n\n\t\tit('does not copy extraneous properties from converter', () => {\n\t\t\tconst node = testTree.buildLeaf(testTree.generateNodeId());\n\t\t\texpect(Object.prototype.hasOwnProperty.call(node, 'payload')).to.be.false;\n\t\t\tconst converted = convertTreeNodes(node, (node) => internalizeBuildNode(node, testTree), isNumber);\n\t\t\texpect(Object.prototype.hasOwnProperty.call(converted, 'payload')).to.be.false;\n\t\t});\n\t});\n\n\tfunction isNumber(node: number | unknown): node is number {\n\t\treturn typeof node === 'number';\n\t}\n\n\tdescribe('comparePayloads', () => {\n\t\tconst serializer: FluidSerializer = new FluidSerializer(\n\t\t\tnew MockFluidDataStoreRuntime().IFluidHandleContext,\n\t\t\t() => {}\n\t\t);\n\t\tconst binder: IFluidHandle = { bind: noop } as unknown as IFluidHandle;\n\n\t\tenum Equality {\n\t\t\tEqual,\n\t\t\tUnequal,\n\t\t\tUnspecified,\n\t\t}\n\n\t\tfunction checkEquality(equal: boolean, equality: Equality): void {\n\t\t\tif (equality !== Equality.Unspecified) {\n\t\t\t\texpect(equal).equals(equality === Equality.Equal);\n\t\t\t}\n\t\t}\n\n\t\tfunction check(\n\t\t\ta: Payload,\n\t\t\tb: Payload,\n\t\t\tflags: { initial: Equality; serialized: Equality; deserialized: Equality; roundtrip: Equality }\n\t\t): void {\n\t\t\t// Check reflexive\n\t\t\texpect(comparePayloads(a, a)).equal(true);\n\t\t\texpect(comparePayloads(b, b)).equal(true);\n\n\t\t\tcheckEquality(comparePayloads(a, b), flags.initial);\n\t\t\t// Check commutative\n\t\t\tcheckEquality(comparePayloads(b, a), flags.initial);\n\n\t\t\tconst [aString, aDeserialized] = checkSerialization(a, flags.roundtrip);\n\t\t\tconst [bString, bDeserialized] = checkSerialization(b, flags.roundtrip);\n\n\t\t\tcheckEquality(aString === bString, flags.serialized);\n\t\t\tcheckEquality(comparePayloads(aDeserialized, bDeserialized), flags.deserialized);\n\t\t\t// Check commutative\n\t\t\tcheckEquality(comparePayloads(bDeserialized, aDeserialized), flags.deserialized);\n\t\t}\n\n\t\tfunction checkSerialization(a: Payload, roundtrip: Equality): [string, Payload] {\n\t\t\tconst aString = serializer.stringify(a, binder);\n\t\t\tconst a2: Payload = serializer.parse(aString);\n\t\t\tconst aString2 = serializer.stringify(a2, binder);\n\t\t\texpect(aString2).equal(aString);\n\t\t\tcheckEquality(comparePayloads(a, a2), roundtrip);\n\n\t\t\t// Check second round trip, should always be equal\n\t\t\tconst a3: Payload = serializer.parse(aString2);\n\t\t\texpect(comparePayloads(a3, a2)).true;\n\n\t\t\treturn [aString, a2];\n\t\t}\n\n\t\tconst allEqual = {\n\t\t\tinitial: Equality.Equal,\n\t\t\tserialized: Equality.Equal,\n\t\t\tdeserialized: Equality.Equal,\n\t\t\troundtrip: Equality.Equal,\n\t\t};\n\n\t\t// For when the inputs are logically equal, but may serialize differently due to field ordering.\n\t\tconst allEqualUnstable = {\n\t\t\tinitial: Equality.Equal,\n\t\t\tserialized: Equality.Unspecified,\n\t\t\tdeserialized: Equality.Equal,\n\t\t\troundtrip: Equality.Equal,\n\t\t};\n\n\t\tconst allUnequal = {\n\t\t\tinitial: Equality.Unequal,\n\t\t\tserialized: Equality.Unequal,\n\t\t\tdeserialized: Equality.Unequal,\n\t\t\troundtrip: Equality.Equal,\n\t\t};\n\n\t\tit('compares numbers correctly', () => {\n\t\t\tcheck(0, 0, allEqual);\n\t\t\tcheck(1, 1, allEqual);\n\t\t\tcheck(0, 1, allUnequal);\n\t\t\tcheck(-1, 1, allUnequal);\n\t\t\tcheck(5.2, 5.200000001, allUnequal);\n\t\t});\n\n\t\tit('compares strings', () => {\n\t\t\tcheck('', '', allEqual);\n\t\t\tcheck(' ', '', allUnequal);\n\t\t\tcheck('1', '+1', allUnequal);\n\t\t\t// This character makes sure multi-byte utf-8 and multi-word utf-16 at least somewhat work\n\t\t\t// Cases like unicode normalization are not covered here here. Normalization or not will be considered ok.\n\t\t\tcheck('𤭢', '𤭢', allEqual);\n\t\t\tcheck('𤭢', '', allUnequal);\n\t\t\tcheck('several characters', 'several characters', allEqual);\n\t\t\tcheck('several characters', 'several_characters', allUnequal);\n\t\t});\n\n\t\tit('compares arrays', () => {\n\t\t\tcheck([], [], allEqual);\n\t\t\tcheck([1], [1], allEqual);\n\t\t\tcheck([[1]], [[1]], allEqual);\n\t\t\tcheck([[1]], [[2]], allUnequal);\n\t\t\tcheck([], [1], allUnequal);\n\t\t\tcheck([1, 2], [2, 1], allUnequal);\n\t\t});\n\n\t\tit('compares objects', () => {\n\t\t\tcheck({ 1: 'x' }, { 1: 'x' }, allEqual);\n\t\t\tcheck({ x: 'x' }, { y: 'x' }, allUnequal);\n\t\t\tcheck({ x: 'x' }, { x: {} }, allUnequal);\n\t\t\tcheck({ x: {} }, { x: {} }, allEqual);\n\t\t\tcheck({ x: [1, 2, 3, 5] }, { x: [1, 2, 3, 4] }, allUnequal);\n\t\t\tcheck({ 1: 'x' }, {}, allUnequal);\n\t\t\tcheck({ x: 'x' }, { x: 'x', y: 'x' }, allUnequal);\n\t\t\tcheck({ field: 'a' }, { field: 'b' }, allUnequal);\n\n\t\t\t// Fluid Serialization arbitrarily orders fields.\n\t\t\t// Thus any object with more than one field may have non-deterministic serialization.\n\t\t\t// However objects have field order, and we need to check comparePayloads is not impacted by it.\n\t\t\tcheck({ y: 'a', x: 'b' }, { x: 'b', y: 'a' }, allEqualUnstable);\n\t\t});\n\n\t\tit('compares mixed types', () => {\n\t\t\tcheck({ 0: 1 }, [1], allUnequal);\n\t\t\t// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface)\n\t\t\tcheck(null, 'null', allUnequal);\n\t\t\tcheck(null, 'null', allUnequal);\n\t\t\tcheck(1, '1', allUnequal);\n\t\t\tcheck(null, 0, allUnequal);\n\t\t\tcheck('', 0, allUnequal);\n\t\t});\n\n\t\tconst sameAfter = {\n\t\t\tinitial: Equality.Unspecified,\n\t\t\tserialized: Equality.Unspecified,\n\t\t\tdeserialized: Equality.Equal,\n\t\t\troundtrip: Equality.Unspecified,\n\t\t};\n\t\tconst differentAfter = {\n\t\t\tinitial: Equality.Unequal,\n\t\t\tserialized: Equality.Unequal,\n\t\t\tdeserialized: Equality.Unequal,\n\t\t\troundtrip: Equality.Unspecified,\n\t\t};\n\n\t\tit('lossy cases', () => {\n\t\t\t// Undefined fields are omitted in json, and thus lost on the round trip.\n\t\t\tcheck({ x: undefined }, { y: undefined }, sameAfter);\n\t\t\tcheck({ x: undefined }, {}, sameAfter);\n\n\t\t\t// NaN and Infinity become null\n\t\t\tcheck(NaN, NaN, sameAfter);\n\t\t\tcheck(NaN, 7, differentAfter);\n\t\t\tcheck(Infinity, Infinity, sameAfter);\n\t\t\tcheck(-Infinity, Infinity, sameAfter);\n\t\t\tcheck(NaN, 'NaN', differentAfter);\n\n\t\t\t// json loses -0 on round trip\n\t\t\tcheck(-0, -0, sameAfter);\n\t\t});\n\n\t\tit('compares handles', () => {\n\t\t\t// This is used instead of MockHandle so equal handles compare deeply equal.\n\t\t\tfunction makeMockHandle(data: string): IFluidHandle {\n\t\t\t\t// `/` prefix is needed to prevent serializing from modifying handle.\n\t\t\t\tconst handleObject = { absolutePath: `/${data}`, IFluidHandle: undefined as unknown };\n\t\t\t\thandleObject.IFluidHandle = handleObject;\n\t\t\t\treturn handleObject as IFluidHandle;\n\t\t\t}\n\t\t\t// Theoretically handles serialize as objects with 2 fields and thus serialization is allowed to be non-deterministic\n\t\t\t// so use allEqualUnstable not allEqual.\n\t\t\tcheck(makeMockHandle('x'), makeMockHandle('x'), allEqualUnstable);\n\t\t\tcheck(makeMockHandle('x'), makeMockHandle('y'), allUnequal);\n\t\t\tcheck({ x: makeMockHandle('x') }, makeMockHandle('x'), allUnequal);\n\t\t});\n\n\t\t// These are cases that are allowed by the type system and produce unexpected results due to Json serialization.\n\t\t// Clear documentation and/or adjustments to equality, type checking or serialization would help with these cases.\n\t\tit.skip('strange cases', () => {\n\t\t\t// Top level undefined fails in JSON.parse.\n\t\t\t// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface.)\n\t\t\tcheck(undefined, null, sameAfter);\n\t\t});\n\t});\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Forest.perf.tests.d.ts","sourceRoot":"","sources":["../../src/test/Forest.perf.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|