@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,73 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { strict as assert } from 'assert';
|
|
6
|
-
import { expect } from 'chai';
|
|
7
|
-
import { validateAssertionError } from '@fluidframework/test-runtime-utils';
|
|
8
|
-
import { MutableStringInterner } from '../StringInterner.js';
|
|
9
|
-
describe('MutableStringInterner', () => {
|
|
10
|
-
const inputStrings = ['test', 'test2', 'test3', 'test4'];
|
|
11
|
-
it('can associate a string with an intern ID', () => {
|
|
12
|
-
const interner = new MutableStringInterner();
|
|
13
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
14
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
15
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
16
|
-
});
|
|
17
|
-
it('can handle empty strings', () => {
|
|
18
|
-
const interner = new MutableStringInterner();
|
|
19
|
-
expect(interner.getOrCreateInternedId('')).to.equal(0);
|
|
20
|
-
});
|
|
21
|
-
it('getInternedId returns undefined for un-created ids', () => {
|
|
22
|
-
const interner = new MutableStringInterner();
|
|
23
|
-
expect(interner.getInternedId(inputStrings[0])).to.equal(undefined);
|
|
24
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
25
|
-
expect(interner.getInternedId(inputStrings[0])).to.equal(0);
|
|
26
|
-
expect(interner.getInternedId(inputStrings[1])).to.equal(undefined);
|
|
27
|
-
});
|
|
28
|
-
it('can retrieve the intern ID associated with a string', () => {
|
|
29
|
-
const interner = new MutableStringInterner();
|
|
30
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
31
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
32
|
-
expect(interner.getInternedId(inputStrings[0])).to.equal(0);
|
|
33
|
-
expect(interner.getInternedId(inputStrings[1])).to.equal(1);
|
|
34
|
-
expect(interner.getString(0)).to.equal(inputStrings[0]);
|
|
35
|
-
expect(interner.getString(1)).to.equal(inputStrings[1]);
|
|
36
|
-
});
|
|
37
|
-
it("throws an error when trying to retrieve a string that hasn't been encountered", () => {
|
|
38
|
-
const interner = new MutableStringInterner();
|
|
39
|
-
assert.throws(() => interner.getString(0), (e) => validateAssertionError(e, 'No string associated with 0.'));
|
|
40
|
-
});
|
|
41
|
-
it('can return a serializable representation of its state', () => {
|
|
42
|
-
const interner = new MutableStringInterner();
|
|
43
|
-
for (const value of inputStrings) {
|
|
44
|
-
interner.getOrCreateInternedId(value);
|
|
45
|
-
}
|
|
46
|
-
expect(interner.getSerializable()).to.deep.equal(inputStrings);
|
|
47
|
-
});
|
|
48
|
-
it('can be initialized with a list of input strings', () => {
|
|
49
|
-
const interner = new MutableStringInterner(inputStrings);
|
|
50
|
-
expect(interner.getOrCreateInternedId(inputStrings[3])).to.equal(3);
|
|
51
|
-
expect(interner.getOrCreateInternedId(inputStrings[2])).to.equal(2);
|
|
52
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
53
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
54
|
-
});
|
|
55
|
-
it('can be initialized with a list of input strings that include duplicate IDs', () => {
|
|
56
|
-
const interner = new MutableStringInterner([...inputStrings, ...inputStrings]);
|
|
57
|
-
expect(interner.getOrCreateInternedId(inputStrings[3])).to.equal(3);
|
|
58
|
-
expect(interner.getOrCreateInternedId(inputStrings[2])).to.equal(2);
|
|
59
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
60
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
61
|
-
});
|
|
62
|
-
it("doesn't change a string's intern ID when retrieving it multiple times", () => {
|
|
63
|
-
const interner = new MutableStringInterner();
|
|
64
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
65
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
66
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
67
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
68
|
-
expect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);
|
|
69
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
70
|
-
expect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=StringInterner.tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StringInterner.tests.js","sourceRoot":"","sources":["../../src/test/StringInterner.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACtC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAEzD,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACnD,MAAM,QAAQ,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAE7C,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpE,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpE,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,YAA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corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from 'assert';\nimport { expect } from 'chai';\nimport { validateAssertionError } from '@fluidframework/test-runtime-utils';\nimport { MutableStringInterner } from '../StringInterner.js';\n\ndescribe('MutableStringInterner', () => {\n\tconst inputStrings = ['test', 'test2', 'test3', 'test4'];\n\n\tit('can associate a string with an intern ID', () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t});\n\n\tit('can handle empty strings', () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\texpect(interner.getOrCreateInternedId('')).to.equal(0);\n\t});\n\n\tit('getInternedId returns undefined for un-created ids', () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\texpect(interner.getInternedId(inputStrings[0])).to.equal(undefined);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getInternedId(inputStrings[1])).to.equal(undefined);\n\t});\n\n\tit('can retrieve the intern ID associated with a string', () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getInternedId(inputStrings[1])).to.equal(1);\n\n\t\texpect(interner.getString(0)).to.equal(inputStrings[0]);\n\t\texpect(interner.getString(1)).to.equal(inputStrings[1]);\n\t});\n\n\tit(\"throws an error when trying to retrieve a string that hasn't been encountered\", () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\tassert.throws(\n\t\t\t() => interner.getString(0),\n\t\t\t(e: Error) => validateAssertionError(e, 'No string associated with 0.')\n\t\t);\n\t});\n\n\tit('can return a serializable representation of its state', () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\tfor (const value of inputStrings) {\n\t\t\tinterner.getOrCreateInternedId(value);\n\t\t}\n\n\t\texpect(interner.getSerializable()).to.deep.equal(inputStrings);\n\t});\n\n\tit('can be initialized with a list of input strings', () => {\n\t\tconst interner = new MutableStringInterner(inputStrings);\n\n\t\texpect(interner.getOrCreateInternedId(inputStrings[3])).to.equal(3);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[2])).to.equal(2);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t});\n\n\tit('can be initialized with a list of input strings that include duplicate IDs', () => {\n\t\tconst interner = new MutableStringInterner([...inputStrings, ...inputStrings]);\n\n\t\texpect(interner.getOrCreateInternedId(inputStrings[3])).to.equal(3);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[2])).to.equal(2);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t});\n\n\tit(\"doesn't change a string's intern ID when retrieving it multiple times\", () => {\n\t\tconst interner = new MutableStringInterner();\n\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[0])).to.equal(0);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t\texpect(interner.getOrCreateInternedId(inputStrings[1])).to.equal(1);\n\t});\n});\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { WriteFormat } from '../persisted-types/index.js';
|
|
2
|
-
import { SharedTree } from '../SharedTree.js';
|
|
3
|
-
/** Applies a smattering of interesting edits to the given shared tree in an attempt to cover a variety of use cases */
|
|
4
|
-
export declare function applyTestEdits(sharedTree: SharedTree): void;
|
|
5
|
-
export declare function createSummaryTestTree(writeFormat: WriteFormat, summarizeHistory: boolean): Promise<SharedTree>;
|
|
6
|
-
export declare function runSummaryTests(title: string): void;
|
|
7
|
-
//# sourceMappingURL=Summary.tests.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.tests.d.ts","sourceRoot":"","sources":["../../src/test/Summary.tests.ts"],"names":[],"mappings":"AAcA,OAAO,EAA+D,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEvH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkB9C,wHAAwH;AACxH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAsF3D;AAED,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAmCpH;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CA8NnD"}
|
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import * as fs from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
7
|
-
import { expect, assert } from 'chai';
|
|
8
|
-
import { v5 } from 'uuid';
|
|
9
|
-
import { SummaryType } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { Change, StablePlace, StableRange } from '../ChangeTypes.js';
|
|
11
|
-
import { fail } from '../Common.js';
|
|
12
|
-
import { areRevisionViewsSemanticallyEqual } from '../EditUtilities.js';
|
|
13
|
-
import { initialTree } from '../InitialTree.js';
|
|
14
|
-
import { reservedIdCount, WriteFormat } from '../persisted-types/index.js';
|
|
15
|
-
import { getChangeNodeFromView } from '../SerializationUtilities.js';
|
|
16
|
-
import { deserialize, getSummaryStatistics } from '../SummaryBackCompatibility.js';
|
|
17
|
-
import { IdCompressor } from '../id-compressor/index.js';
|
|
18
|
-
import { convertEditIds } from '../IdConversion.js';
|
|
19
|
-
import { MutableStringInterner } from '../StringInterner.js';
|
|
20
|
-
import { sequencedIdNormalizer } from '../NodeIdUtilities.js';
|
|
21
|
-
import { expectDefined } from './utilities/TestCommon.js';
|
|
22
|
-
import { TestFluidSerializer } from './utilities/TestSerializer.js';
|
|
23
|
-
import { getEditLogInternal, getIdNormalizerFromSharedTree, makeNodeIdContext, setUpLocalServerTestSharedTree, testDocumentsPathBase, } from './utilities/TestUtilities.js';
|
|
24
|
-
const directory = join(testDocumentsPathBase, 'summary-tests');
|
|
25
|
-
/** Applies a smattering of interesting edits to the given shared tree in an attempt to cover a variety of use cases */
|
|
26
|
-
export function applyTestEdits(sharedTree) {
|
|
27
|
-
const uuid = new DeterministicIdGenerator(sharedTree.getWriteFormat(), sharedTree);
|
|
28
|
-
function applyEdit(changes) {
|
|
29
|
-
const internalChanges = changes.map((c) => sharedTree.internalizeChange(c));
|
|
30
|
-
sharedTree.applyEditInternal({ id: uuid.getNextEditId(), changes: internalChanges });
|
|
31
|
-
}
|
|
32
|
-
/*
|
|
33
|
-
* Build a tree that looks like the following:
|
|
34
|
-
*
|
|
35
|
-
* ROOT
|
|
36
|
-
* | 'root'
|
|
37
|
-
* [root]
|
|
38
|
-
* 'left' / \ 'right'
|
|
39
|
-
* [A] [B, C, D]
|
|
40
|
-
* | 'leaf'
|
|
41
|
-
* [E('payload')]
|
|
42
|
-
*/
|
|
43
|
-
const cDetachedId = 0;
|
|
44
|
-
const rootDetachedId = 1;
|
|
45
|
-
const aId = uuid.getNextNodeId();
|
|
46
|
-
const cId = uuid.getNextNodeId();
|
|
47
|
-
const dId = uuid.getNextNodeId();
|
|
48
|
-
applyEdit([
|
|
49
|
-
Change.build([
|
|
50
|
-
{
|
|
51
|
-
definition: 'C',
|
|
52
|
-
identifier: cId,
|
|
53
|
-
traits: {
|
|
54
|
-
leaf: [
|
|
55
|
-
{
|
|
56
|
-
definition: 'E',
|
|
57
|
-
identifier: uuid.getNextNodeId(),
|
|
58
|
-
payload: 'payload',
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
], cDetachedId),
|
|
64
|
-
Change.build([
|
|
65
|
-
{
|
|
66
|
-
definition: 'Root',
|
|
67
|
-
identifier: uuid.getNextNodeId(),
|
|
68
|
-
traits: {
|
|
69
|
-
left: [{ definition: 'A', identifier: aId }],
|
|
70
|
-
right: [
|
|
71
|
-
{ definition: 'B', identifier: uuid.getNextNodeId() },
|
|
72
|
-
cDetachedId,
|
|
73
|
-
{ definition: 'D', identifier: dId },
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
], rootDetachedId),
|
|
78
|
-
Change.insert(rootDetachedId, StablePlace.atStartOf({
|
|
79
|
-
label: 'root',
|
|
80
|
-
parent: sharedTree.convertToNodeId(initialTree.identifier),
|
|
81
|
-
})),
|
|
82
|
-
]);
|
|
83
|
-
/**
|
|
84
|
-
* Edit the tree
|
|
85
|
-
*
|
|
86
|
-
* 1. Move C after A
|
|
87
|
-
* 2. Delete D
|
|
88
|
-
* 3.
|
|
89
|
-
* ...
|
|
90
|
-
* 102. Set the payload of A to _i_ for all _i_ in 0...100
|
|
91
|
-
*/
|
|
92
|
-
applyEdit([...Change.move(StableRange.only(cId), StablePlace.after(aId))]);
|
|
93
|
-
applyEdit([Change.delete(StableRange.only(dId))]);
|
|
94
|
-
for (let i = 0; i < 100; i++) {
|
|
95
|
-
applyEdit([Change.setPayload(aId, i)]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
export async function createSummaryTestTree(writeFormat, summarizeHistory) {
|
|
99
|
-
const { tree, testObjectProvider } = await setUpLocalServerTestSharedTree({
|
|
100
|
-
writeFormat,
|
|
101
|
-
summarizeHistory,
|
|
102
|
-
uploadEditChunks: summarizeHistory,
|
|
103
|
-
});
|
|
104
|
-
if (writeFormat === WriteFormat.v0_1_1) {
|
|
105
|
-
const idCompressor = new IdCompressor('968bee41-bcf7-46d2-8035-6eb163b76c4c', reservedIdCount);
|
|
106
|
-
const interner = new MutableStringInterner([initialTree.definition]);
|
|
107
|
-
const context = makeNodeIdContext(idCompressor);
|
|
108
|
-
const normalizer = sequencedIdNormalizer(context);
|
|
109
|
-
const sharedTreeSummaryWithConstantSessionId = {
|
|
110
|
-
version: WriteFormat.v0_1_1,
|
|
111
|
-
currentTree: summarizeHistory
|
|
112
|
-
? [
|
|
113
|
-
interner.getOrCreateInternedId(initialTree.definition),
|
|
114
|
-
normalizer.normalizeToOpSpace(context.convertToNodeId(initialTree.identifier)),
|
|
115
|
-
]
|
|
116
|
-
: undefined,
|
|
117
|
-
editHistory: {
|
|
118
|
-
editIds: [],
|
|
119
|
-
editChunks: [],
|
|
120
|
-
},
|
|
121
|
-
idCompressor: idCompressor.serialize(true),
|
|
122
|
-
internedStrings: interner.getSerializable(),
|
|
123
|
-
};
|
|
124
|
-
tree.loadSummary(sharedTreeSummaryWithConstantSessionId);
|
|
125
|
-
}
|
|
126
|
-
applyTestEdits(tree);
|
|
127
|
-
await testObjectProvider.ensureSynchronized();
|
|
128
|
-
return tree;
|
|
129
|
-
}
|
|
130
|
-
export function runSummaryTests(title) {
|
|
131
|
-
describe(title, () => {
|
|
132
|
-
// Note: this test serializer doesn't handle blobs properly (it just uses JSON.stringify/JSON.parse).
|
|
133
|
-
const testSerializer = new TestFluidSerializer();
|
|
134
|
-
const { summaryFileWithHistory_0_0_2, summaryFileNoHistory_0_0_2, summaryFileEmptyTraits_0_0_2, summaryFileWithHistory_0_1_1, summaryFileNoHistory_0_1_1, summaryFileUpgrade_0_1_1, } = loadSummaryTestFiles();
|
|
135
|
-
// Re-enable this test for an easy way to write the test summary files to disk
|
|
136
|
-
it.skip('save files to disk', async () => {
|
|
137
|
-
await makeSummaryTestFiles();
|
|
138
|
-
});
|
|
139
|
-
describe('0.0.2 write format', () => {
|
|
140
|
-
const setUp002Tree = async (options) => setUpLocalServerTestSharedTree({ writeFormat: WriteFormat.v0_0_2, ...options });
|
|
141
|
-
const setUp002SummaryTestTree = async (summarizeHistory) => createSummaryTestTree(WriteFormat.v0_0_2, summarizeHistory);
|
|
142
|
-
it('Normalizes a denormalized summary containing nodes with empty traits', async () => {
|
|
143
|
-
const { tree } = await setUp002Tree({});
|
|
144
|
-
tree.loadSerializedSummary(summaryFileEmptyTraits_0_0_2);
|
|
145
|
-
const { tree: expectedTree } = await setUp002Tree({});
|
|
146
|
-
expectedTree.loadSerializedSummary(summaryFileWithHistory_0_0_2);
|
|
147
|
-
expect(getChangeNodeFromView(tree.currentView)).deep.equals(getChangeNodeFromView(expectedTree.currentView));
|
|
148
|
-
});
|
|
149
|
-
it('writes 0.0.2 files without history', async () => {
|
|
150
|
-
const tree = await setUp002SummaryTestTree(false);
|
|
151
|
-
const { summary: attachSummary } = tree.getAttachSummary();
|
|
152
|
-
expect(attachSummary.type).to.equal(SummaryType.Tree, 'Summary type should be Tree');
|
|
153
|
-
expect(attachSummary.tree.header.type).to.equal(SummaryType.Blob, 'Summary should contain header blob');
|
|
154
|
-
const serializedSummary = attachSummary.tree.header.content;
|
|
155
|
-
const summary = JSON.parse(serializedSummary);
|
|
156
|
-
const expectedSummary = JSON.parse(summaryFileNoHistory_0_0_2);
|
|
157
|
-
// The edit ID of the single "no history edit" is generated randomly. Replace it with the baseline edit for the sake of this test.
|
|
158
|
-
summary.sequencedEdits[0].id = expectedSummary.sequencedEdits[0].id;
|
|
159
|
-
expect(summary).to.deep.equal(expectedSummary);
|
|
160
|
-
});
|
|
161
|
-
it('writes 0.0.2 files with history', async () => {
|
|
162
|
-
const tree = await setUp002SummaryTestTree(true);
|
|
163
|
-
expect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(JSON.parse(summaryFileWithHistory_0_0_2));
|
|
164
|
-
});
|
|
165
|
-
describe('reading the same version', () => {
|
|
166
|
-
it('reads 0.0.2 files without history', async () => {
|
|
167
|
-
const { tree } = await setUp002Tree({});
|
|
168
|
-
tree.loadSerializedSummary(summaryFileNoHistory_0_0_2);
|
|
169
|
-
// Tree should have exactly one edit, as all "no history" summaries do.
|
|
170
|
-
expect(tree.edits.length).to.equal(1);
|
|
171
|
-
// Load a baseline tree's own summary with no history to compare with
|
|
172
|
-
const summaryNoHistory = (await setUp002SummaryTestTree(false)).saveSummary();
|
|
173
|
-
const { tree: expectedTree } = await setUp002Tree({ summarizeHistory: false });
|
|
174
|
-
expectedTree.loadSummary(summaryNoHistory);
|
|
175
|
-
await expectSharedTreesEqual(tree, expectedTree, false);
|
|
176
|
-
});
|
|
177
|
-
it('reads 0.0.2 files with history', async () => {
|
|
178
|
-
const { tree } = await setUp002Tree({});
|
|
179
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_0_2);
|
|
180
|
-
const expectedTree = await setUp002SummaryTestTree(true);
|
|
181
|
-
await expectSharedTreesEqual(tree, expectedTree);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
describe('reading next version', () => {
|
|
185
|
-
it('reads 0.1.1', async () => {
|
|
186
|
-
const { tree } = await setUp002Tree({});
|
|
187
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_1_1);
|
|
188
|
-
// TODO: There may need to be a testObjectProvider synchronization here to upload
|
|
189
|
-
// blobs from this summary.
|
|
190
|
-
// We should also look at how this test asserts behavior w.r.t blobs.
|
|
191
|
-
const newSummary = JSON.parse(tree.saveSerializedSummary());
|
|
192
|
-
const expectedSummary = JSON.parse(summaryFileWithHistory_0_1_1);
|
|
193
|
-
expect(newSummary).to.deep.equal(expectedSummary);
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
it('gives correct SummaryStatistics', async () => {
|
|
197
|
-
const { tree } = await setUp002Tree({});
|
|
198
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_0_2);
|
|
199
|
-
const editCount = tree.edits.length;
|
|
200
|
-
const summary = deserialize(summaryFileWithHistory_0_0_2, testSerializer);
|
|
201
|
-
const telemetryInfo = getSummaryStatistics(summary);
|
|
202
|
-
const expectedTelemetryInfo = {
|
|
203
|
-
formatVersion: WriteFormat.v0_0_2,
|
|
204
|
-
historySize: editCount,
|
|
205
|
-
};
|
|
206
|
-
expect(telemetryInfo).to.deep.equals(expectedTelemetryInfo);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
describe('0.1.1 write format', () => {
|
|
210
|
-
const setUp011Tree = async (options) => setUpLocalServerTestSharedTree({ writeFormat: WriteFormat.v0_1_1, ...options });
|
|
211
|
-
const setUp011SummaryTestTree = async (summarizeHistory) => createSummaryTestTree(WriteFormat.v0_1_1, summarizeHistory);
|
|
212
|
-
it('writes 0.1.1 files without history', async () => {
|
|
213
|
-
const tree = await setUp011SummaryTestTree(false);
|
|
214
|
-
const summary = JSON.parse(tree.saveSerializedSummary());
|
|
215
|
-
const expectedSummary = JSON.parse(summaryFileNoHistory_0_1_1);
|
|
216
|
-
// The edit ID of the single "no history edit" is generated randomly. Replace it with the baseline edit for the sake of this test.
|
|
217
|
-
expectDefined(summary.editHistory).editIds[0] = expectDefined(expectedSummary.editHistory?.editIds[0]);
|
|
218
|
-
expect(summary).to.deep.equal(expectedSummary);
|
|
219
|
-
});
|
|
220
|
-
it('writes 0.1.1 files with history', async () => {
|
|
221
|
-
const tree = await setUp011SummaryTestTree(true);
|
|
222
|
-
expect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(JSON.parse(summaryFileWithHistory_0_1_1));
|
|
223
|
-
});
|
|
224
|
-
describe('reading the same version', () => {
|
|
225
|
-
it('reads 0.1.1 files without history', async () => {
|
|
226
|
-
const { tree } = await setUp011Tree({});
|
|
227
|
-
tree.loadSerializedSummary(summaryFileNoHistory_0_1_1);
|
|
228
|
-
// Tree should have exactly one edit, as all "no history" summaries do.
|
|
229
|
-
expect(tree.edits.length).to.equal(1);
|
|
230
|
-
// Load a baseline tree's own summary with no history to compare with
|
|
231
|
-
const summaryNoHistory = (await setUp011SummaryTestTree(false)).saveSummary();
|
|
232
|
-
const { tree: expectedTree } = await setUp011Tree({ summarizeHistory: false });
|
|
233
|
-
expectedTree.loadSummary(summaryNoHistory);
|
|
234
|
-
await expectSharedTreesEqual(tree, expectedTree, false);
|
|
235
|
-
});
|
|
236
|
-
it('reads 0.1.1 files with history', async () => {
|
|
237
|
-
const { tree } = await setUp011Tree({});
|
|
238
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_1_1);
|
|
239
|
-
const expectedTree = await setUp011SummaryTestTree(false);
|
|
240
|
-
await expectSharedTreesEqual(tree, expectedTree);
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
describe('reading previous versions', () => {
|
|
244
|
-
it('reads 0.0.2', async () => {
|
|
245
|
-
const expectedTree = await setUp011SummaryTestTree(true);
|
|
246
|
-
const { tree } = await setUp011Tree({});
|
|
247
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_0_2);
|
|
248
|
-
await expectSharedTreesEqual(tree, expectedTree);
|
|
249
|
-
expect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(JSON.parse(summaryFileWithHistory_0_0_2));
|
|
250
|
-
});
|
|
251
|
-
it('upgrades 0.0.2', async () => {
|
|
252
|
-
const { tree, testObjectProvider } = await setUp011Tree({});
|
|
253
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_0_2);
|
|
254
|
-
// Synchronize to give a chance for the update op to be sequenced.
|
|
255
|
-
await testObjectProvider.ensureSynchronized();
|
|
256
|
-
const expectedTree = await setUp011SummaryTestTree(true);
|
|
257
|
-
await expectSharedTreesEqual(tree, expectedTree);
|
|
258
|
-
expect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(JSON.parse(summaryFileUpgrade_0_1_1));
|
|
259
|
-
});
|
|
260
|
-
it('upgrades 0.0.2 that has several stale ops that it resubmits', async () => {
|
|
261
|
-
const { tree: resubmitTree, testObjectProvider } = await setUpLocalServerTestSharedTree({
|
|
262
|
-
writeFormat: WriteFormat.v0_0_2,
|
|
263
|
-
});
|
|
264
|
-
applyTestEdits(resubmitTree);
|
|
265
|
-
const { tree: tree } = await setUpLocalServerTestSharedTree({
|
|
266
|
-
writeFormat: WriteFormat.v0_1_1,
|
|
267
|
-
testObjectProvider,
|
|
268
|
-
});
|
|
269
|
-
await testObjectProvider.ensureSynchronized();
|
|
270
|
-
await expectSharedTreesEqual(resubmitTree, tree);
|
|
271
|
-
await expectSharedTreesEqual(tree, await createSummaryTestTree(WriteFormat.v0_1_1, true));
|
|
272
|
-
});
|
|
273
|
-
it('Normalizes a denormalized summary containing nodes with empty traits', async () => {
|
|
274
|
-
const { tree } = await setUp011Tree({});
|
|
275
|
-
tree.loadSerializedSummary(summaryFileEmptyTraits_0_0_2);
|
|
276
|
-
const { tree: expectedTree } = await setUp011Tree({});
|
|
277
|
-
expectedTree.loadSerializedSummary(summaryFileWithHistory_0_0_2);
|
|
278
|
-
expect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, expectedTree.currentView, expectedTree));
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
it('gives correct SummaryStatistics', async () => {
|
|
282
|
-
const { tree } = await setUp011Tree({});
|
|
283
|
-
tree.loadSerializedSummary(summaryFileWithHistory_0_1_1);
|
|
284
|
-
const editCount = tree.edits.length;
|
|
285
|
-
const summary = deserialize(summaryFileWithHistory_0_1_1, testSerializer);
|
|
286
|
-
const telemetryInfo = getSummaryStatistics(summary);
|
|
287
|
-
const totalChunks = 1;
|
|
288
|
-
const expectedTelemetryInfo = {
|
|
289
|
-
formatVersion: WriteFormat.v0_1_1,
|
|
290
|
-
historySize: editCount,
|
|
291
|
-
totalNumberOfChunks: totalChunks,
|
|
292
|
-
uploadedChunks: 0,
|
|
293
|
-
};
|
|
294
|
-
expect(telemetryInfo).to.deep.equals(expectedTelemetryInfo);
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
async function expectSharedTreesEqual(sharedTreeA, sharedTreeB, compareEditIds = true) {
|
|
300
|
-
if (!areRevisionViewsSemanticallyEqual(sharedTreeA.currentView, sharedTreeA, sharedTreeB.currentView, sharedTreeB)) {
|
|
301
|
-
expect.fail('trees have different current views');
|
|
302
|
-
}
|
|
303
|
-
if (sharedTreeA.edits.length !== sharedTreeB.edits.length) {
|
|
304
|
-
expect.fail('trees have different amounts of edits');
|
|
305
|
-
}
|
|
306
|
-
for (let i = 0; i < sharedTreeA.edits.length; i++) {
|
|
307
|
-
const roundTrip = (obj) => JSON.parse(JSON.stringify(obj));
|
|
308
|
-
const editA = roundTrip(convertEditIds(getEditLogInternal(sharedTreeA).tryGetEditAtIndex(i) ?? fail('edit not found'), (id) => sharedTreeA.convertToStableNodeId(id)));
|
|
309
|
-
const editB = roundTrip(convertEditIds(getEditLogInternal(sharedTreeB).tryGetEditAtIndex(i) ?? fail('edit not found'), (id) => sharedTreeB.convertToStableNodeId(id)));
|
|
310
|
-
if (compareEditIds) {
|
|
311
|
-
expect(editA).to.deep.equal(editB, `trees have different edits (index ${i})`);
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
expect(editA.changes).to.deep.equal(editB.changes, `edits have different changes (index ${i})`);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
function loadSummaryTestFiles() {
|
|
319
|
-
const summaryFileWithHistory_0_0_2 = fs.readFileSync(join(directory, 'summary-0-0-2.json'), 'utf8');
|
|
320
|
-
const summaryFileNoHistory_0_0_2 = fs.readFileSync(join(directory, 'summary-no-history-0-0-2.json'), 'utf8');
|
|
321
|
-
const summaryFileEmptyTraits_0_0_2 = fs.readFileSync(join(directory, 'summary-empty-traits-0-0-2.json'), 'utf8');
|
|
322
|
-
const summaryFileWithHistory_0_1_1 = fs.readFileSync(join(directory, 'summary-0-1-1.json'), 'utf8');
|
|
323
|
-
const summaryFileNoHistory_0_1_1 = fs.readFileSync(join(directory, 'summary-no-history-0-1-1.json'), 'utf8');
|
|
324
|
-
const summaryFileUpgrade_0_1_1 = fs.readFileSync(join(directory, 'summary-upgrade-0-1-1.json'), 'utf8');
|
|
325
|
-
return {
|
|
326
|
-
summaryFileWithHistory_0_0_2,
|
|
327
|
-
summaryFileNoHistory_0_0_2,
|
|
328
|
-
summaryFileEmptyTraits_0_0_2,
|
|
329
|
-
summaryFileWithHistory_0_1_1,
|
|
330
|
-
summaryFileNoHistory_0_1_1,
|
|
331
|
-
summaryFileUpgrade_0_1_1,
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
async function makeSummaryTestFiles() {
|
|
335
|
-
try {
|
|
336
|
-
fs.accessSync(directory);
|
|
337
|
-
}
|
|
338
|
-
catch {
|
|
339
|
-
fs.mkdirSync(directory);
|
|
340
|
-
}
|
|
341
|
-
const treeWithHistory_0_0_2 = await createSummaryTestTree(WriteFormat.v0_0_2, true);
|
|
342
|
-
const treeNoHistory_0_0_2 = await createSummaryTestTree(WriteFormat.v0_0_2, false);
|
|
343
|
-
const treeWithHistory_0_1_1 = await createSummaryTestTree(WriteFormat.v0_1_1, true);
|
|
344
|
-
const treeNoHistory_0_1_1 = await createSummaryTestTree(WriteFormat.v0_1_1, false);
|
|
345
|
-
fs.writeFileSync(join(directory, `summary-0-0-2.json`), treeWithHistory_0_0_2.saveSerializedSummary());
|
|
346
|
-
fs.writeFileSync(join(directory, `summary-no-history-0-0-2.json`), treeNoHistory_0_0_2.saveSerializedSummary());
|
|
347
|
-
fs.writeFileSync(join(directory, `summary-0-1-1.json`), treeWithHistory_0_1_1.saveSerializedSummary());
|
|
348
|
-
fs.writeFileSync(join(directory, `summary-no-history-0-1-1.json`), treeNoHistory_0_1_1.saveSerializedSummary());
|
|
349
|
-
const { tree: upgradedTree, testObjectProvider } = await setUpLocalServerTestSharedTree({
|
|
350
|
-
writeFormat: WriteFormat.v0_1_1,
|
|
351
|
-
summarizeHistory: true,
|
|
352
|
-
});
|
|
353
|
-
upgradedTree.loadSummary(treeWithHistory_0_0_2.saveSummary());
|
|
354
|
-
await testObjectProvider.ensureSynchronized();
|
|
355
|
-
fs.writeFileSync(join(directory, `summary-upgrade-0-1-1.json`), upgradedTree.saveSerializedSummary());
|
|
356
|
-
}
|
|
357
|
-
/** Every instance of this class generates the same sequence of v5 UUIDs */
|
|
358
|
-
class DeterministicIdGenerator {
|
|
359
|
-
constructor(writeFormat, sharedTree) {
|
|
360
|
-
this.writeFormat = writeFormat;
|
|
361
|
-
this.sharedTree = sharedTree;
|
|
362
|
-
this.editIdCount = 0;
|
|
363
|
-
if (this.writeFormat === WriteFormat.v0_1_1) {
|
|
364
|
-
assert(getIdNormalizerFromSharedTree(sharedTree).localSessionId === DeterministicIdGenerator.sessionId);
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
assert(getIdNormalizerFromSharedTree(sharedTree).localSessionId !== DeterministicIdGenerator.sessionId);
|
|
368
|
-
this.constantIdCompressor = new IdCompressor(DeterministicIdGenerator.sessionId, reservedIdCount);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
getNextEditId() {
|
|
372
|
-
return v5((this.editIdCount++).toString(), DeterministicIdGenerator.uuidNamespace);
|
|
373
|
-
}
|
|
374
|
-
getNextNodeId() {
|
|
375
|
-
return this.writeFormat === WriteFormat.v0_0_2
|
|
376
|
-
? this.sharedTree.generateNodeId(this.getNextStableId())
|
|
377
|
-
: this.sharedTree.generateNodeId();
|
|
378
|
-
}
|
|
379
|
-
getNextStableId() {
|
|
380
|
-
assert(this.constantIdCompressor !== undefined);
|
|
381
|
-
return this.constantIdCompressor.decompress(this.constantIdCompressor.generateCompressedId());
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
DeterministicIdGenerator.sessionId = '968bee41-bcf7-46d2-8035-6eb163b76c4c';
|
|
385
|
-
DeterministicIdGenerator.uuidNamespace = '44864298-500e-4cf8-9f44-a249e5b3a286';
|
|
386
|
-
//# sourceMappingURL=Summary.tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.tests.js","sourceRoot":"","sources":["../../src/test/Summary.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAgB,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAoB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAA8C,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAqB,MAAM,gCAAgC,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACN,kBAAkB,EAClB,6BAA6B,EAC7B,iBAAiB,EACjB,8BAA8B,EAC9B,qBAAqB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,CAAC,UAAU,CAAC,CAAC,cAAc,KAAK,wBAAwB,CAAC,SAAS,CAAC,CAAC;YACxG,IAAI,CAAC,oBAAoB,GAAG,IAAI,YAAY,CAAC,wBAAwB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;SAClG;IACF,CAAC;IAEM,aAAa;QACnB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,wBAAwB,CAAC,aAAa,CAAW,CAAC;IAC9F,CAAC;IAEM,aAAa;QACnB,OAAO,IAAI,CAAC,WAAW,KAAK,WAAW,CAAC,MAAM;YAC7C,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YACxD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IACrC,CAAC;IAEO,eAAe;QACtB,MAAM,CAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,CAAa,CAAC;IAC3G,CAAC;;AA9BsB,kCAAS,GAAG,sCAAmD,AAAtD,CAAuD;AAC/D,sCAAa,GAAG,sCAAsC,AAAzC,CAA0C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport * as fs from 'fs';\nimport { join } from 'path';\nimport { expect, assert } from 'chai';\nimport { v5 } from 'uuid';\nimport { ISummaryBlob, SummaryType } from '@fluidframework/protocol-definitions';\nimport { Change, StablePlace, StableRange } from '../ChangeTypes.js';\nimport { fail, RecursiveMutable } from '../Common.js';\nimport { areRevisionViewsSemanticallyEqual } from '../EditUtilities.js';\nimport { EditId, NodeId, SessionId, StableId, TraitLabel } from '../Identifiers.js';\nimport { initialTree } from '../InitialTree.js';\nimport { reservedIdCount, SharedTreeSummary, SharedTreeSummary_0_0_2, WriteFormat } from '../persisted-types/index.js';\nimport { getChangeNodeFromView } from '../SerializationUtilities.js';\nimport { SharedTree } from '../SharedTree.js';\nimport { deserialize, getSummaryStatistics, SummaryStatistics } from '../SummaryBackCompatibility.js';\nimport { IdCompressor } from '../id-compressor/index.js';\nimport { convertEditIds } from '../IdConversion.js';\nimport { MutableStringInterner } from '../StringInterner.js';\nimport { sequencedIdNormalizer } from '../NodeIdUtilities.js';\nimport { expectDefined } from './utilities/TestCommon.js';\nimport { TestFluidSerializer } from './utilities/TestSerializer.js';\nimport {\n\tgetEditLogInternal,\n\tgetIdNormalizerFromSharedTree,\n\tmakeNodeIdContext,\n\tsetUpLocalServerTestSharedTree,\n\ttestDocumentsPathBase,\n} from './utilities/TestUtilities.js';\n\nconst directory = join(testDocumentsPathBase, 'summary-tests');\n\n/** Applies a smattering of interesting edits to the given shared tree in an attempt to cover a variety of use cases */\nexport function applyTestEdits(sharedTree: SharedTree): void {\n\tconst uuid = new DeterministicIdGenerator(sharedTree.getWriteFormat(), sharedTree);\n\n\tfunction applyEdit(changes: Change[]): void {\n\t\tconst internalChanges = changes.map((c) => sharedTree.internalizeChange(c));\n\t\tsharedTree.applyEditInternal({ id: uuid.getNextEditId(), changes: internalChanges });\n\t}\n\n\t/*\n\t * Build a tree that looks like the following:\n\t *\n\t * ROOT\n\t * | 'root'\n\t * [root]\n\t * 'left' / \\ 'right'\n\t * [A] [B, C, D]\n\t * | 'leaf'\n\t * [E('payload')]\n\t */\n\n\tconst cDetachedId = 0;\n\tconst rootDetachedId = 1;\n\tconst aId = uuid.getNextNodeId();\n\tconst cId = uuid.getNextNodeId();\n\tconst dId = uuid.getNextNodeId();\n\n\tapplyEdit([\n\t\tChange.build(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tdefinition: 'C',\n\t\t\t\t\tidentifier: cId,\n\t\t\t\t\ttraits: {\n\t\t\t\t\t\tleaf: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdefinition: 'E',\n\t\t\t\t\t\t\t\tidentifier: uuid.getNextNodeId(),\n\t\t\t\t\t\t\t\tpayload: 'payload',\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\tcDetachedId\n\t\t),\n\t\tChange.build(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tdefinition: 'Root',\n\t\t\t\t\tidentifier: uuid.getNextNodeId(),\n\t\t\t\t\ttraits: {\n\t\t\t\t\t\tleft: [{ definition: 'A', identifier: aId }],\n\t\t\t\t\t\tright: [\n\t\t\t\t\t\t\t{ definition: 'B', identifier: uuid.getNextNodeId() },\n\t\t\t\t\t\t\tcDetachedId,\n\t\t\t\t\t\t\t{ definition: 'D', identifier: dId },\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\trootDetachedId\n\t\t),\n\t\tChange.insert(\n\t\t\trootDetachedId,\n\t\t\tStablePlace.atStartOf({\n\t\t\t\tlabel: 'root' as TraitLabel,\n\t\t\t\tparent: sharedTree.convertToNodeId(initialTree.identifier),\n\t\t\t})\n\t\t),\n\t]);\n\n\t/**\n\t * Edit the tree\n\t *\n\t * 1. Move C after A\n\t * 2. Delete D\n\t * 3.\n\t * ...\n\t * 102. Set the payload of A to _i_ for all _i_ in 0...100\n\t */\n\n\tapplyEdit([...Change.move(StableRange.only(cId), StablePlace.after(aId))]);\n\tapplyEdit([Change.delete(StableRange.only(dId))]);\n\tfor (let i = 0; i < 100; i++) {\n\t\tapplyEdit([Change.setPayload(aId, i)]);\n\t}\n}\n\nexport async function createSummaryTestTree(writeFormat: WriteFormat, summarizeHistory: boolean): Promise<SharedTree> {\n\tconst { tree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\twriteFormat,\n\t\tsummarizeHistory,\n\t\tuploadEditChunks: summarizeHistory,\n\t});\n\n\tif (writeFormat === WriteFormat.v0_1_1) {\n\t\tconst idCompressor = new IdCompressor('968bee41-bcf7-46d2-8035-6eb163b76c4c' as SessionId, reservedIdCount);\n\t\tconst interner = new MutableStringInterner([initialTree.definition]);\n\t\tconst context = makeNodeIdContext(idCompressor);\n\t\tconst normalizer = sequencedIdNormalizer(context);\n\t\tconst sharedTreeSummaryWithConstantSessionId: SharedTreeSummary = {\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tcurrentTree: summarizeHistory\n\t\t\t\t? [\n\t\t\t\t\t\tinterner.getOrCreateInternedId(initialTree.definition),\n\t\t\t\t\t\tnormalizer.normalizeToOpSpace(context.convertToNodeId(initialTree.identifier)),\n\t\t\t\t ]\n\t\t\t\t: undefined,\n\t\t\teditHistory: {\n\t\t\t\teditIds: [],\n\t\t\t\teditChunks: [],\n\t\t\t},\n\t\t\tidCompressor: idCompressor.serialize(true),\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t};\n\n\t\ttree.loadSummary(sharedTreeSummaryWithConstantSessionId);\n\t}\n\n\tapplyTestEdits(tree);\n\n\tawait testObjectProvider.ensureSynchronized();\n\treturn tree;\n}\n\nexport function runSummaryTests(title: string): void {\n\tdescribe(title, () => {\n\t\t// Note: this test serializer doesn't handle blobs properly (it just uses JSON.stringify/JSON.parse).\n\t\tconst testSerializer = new TestFluidSerializer();\n\n\t\tconst {\n\t\t\tsummaryFileWithHistory_0_0_2,\n\t\t\tsummaryFileNoHistory_0_0_2,\n\t\t\tsummaryFileEmptyTraits_0_0_2,\n\t\t\tsummaryFileWithHistory_0_1_1,\n\t\t\tsummaryFileNoHistory_0_1_1,\n\t\t\tsummaryFileUpgrade_0_1_1,\n\t\t} = loadSummaryTestFiles();\n\n\t\t// Re-enable this test for an easy way to write the test summary files to disk\n\t\tit.skip('save files to disk', async () => {\n\t\t\tawait makeSummaryTestFiles();\n\t\t});\n\n\t\tdescribe('0.0.2 write format', () => {\n\t\t\tconst setUp002Tree: typeof setUpLocalServerTestSharedTree = async (options) =>\n\t\t\t\tsetUpLocalServerTestSharedTree({ writeFormat: WriteFormat.v0_0_2, ...options });\n\n\t\t\tconst setUp002SummaryTestTree = async (summarizeHistory: boolean): Promise<SharedTree> =>\n\t\t\t\tcreateSummaryTestTree(WriteFormat.v0_0_2, summarizeHistory);\n\n\t\t\tit('Normalizes a denormalized summary containing nodes with empty traits', async () => {\n\t\t\t\tconst { tree } = await setUp002Tree({});\n\t\t\t\ttree.loadSerializedSummary(summaryFileEmptyTraits_0_0_2);\n\n\t\t\t\tconst { tree: expectedTree } = await setUp002Tree({});\n\t\t\t\texpectedTree.loadSerializedSummary(summaryFileWithHistory_0_0_2);\n\t\t\t\texpect(getChangeNodeFromView(tree.currentView)).deep.equals(\n\t\t\t\t\tgetChangeNodeFromView(expectedTree.currentView)\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tit('writes 0.0.2 files without history', async () => {\n\t\t\t\tconst tree = await setUp002SummaryTestTree(false);\n\n\t\t\t\tconst { summary: attachSummary } = tree.getAttachSummary();\n\t\t\t\texpect(attachSummary.type).to.equal(SummaryType.Tree, 'Summary type should be Tree');\n\t\t\t\texpect(attachSummary.tree.header.type).to.equal(SummaryType.Blob, 'Summary should contain header blob');\n\t\t\t\tconst serializedSummary = (attachSummary.tree.header as ISummaryBlob).content as string;\n\n\t\t\t\tconst summary: RecursiveMutable<SharedTreeSummary_0_0_2> = JSON.parse(serializedSummary);\n\t\t\t\tconst expectedSummary: SharedTreeSummary_0_0_2 = JSON.parse(summaryFileNoHistory_0_0_2);\n\t\t\t\t// The edit ID of the single \"no history edit\" is generated randomly. Replace it with the baseline edit for the sake of this test.\n\t\t\t\tsummary.sequencedEdits[0].id = expectedSummary.sequencedEdits[0].id;\n\t\t\t\texpect(summary).to.deep.equal(expectedSummary);\n\t\t\t});\n\n\t\t\tit('writes 0.0.2 files with history', async () => {\n\t\t\t\tconst tree = await setUp002SummaryTestTree(true);\n\t\t\t\texpect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(\n\t\t\t\t\tJSON.parse(summaryFileWithHistory_0_0_2)\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tdescribe('reading the same version', () => {\n\t\t\t\tit('reads 0.0.2 files without history', async () => {\n\t\t\t\t\tconst { tree } = await setUp002Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileNoHistory_0_0_2);\n\t\t\t\t\t// Tree should have exactly one edit, as all \"no history\" summaries do.\n\t\t\t\t\texpect(tree.edits.length).to.equal(1);\n\t\t\t\t\t// Load a baseline tree's own summary with no history to compare with\n\t\t\t\t\tconst summaryNoHistory = (await setUp002SummaryTestTree(false)).saveSummary();\n\t\t\t\t\tconst { tree: expectedTree } = await setUp002Tree({ summarizeHistory: false });\n\t\t\t\t\texpectedTree.loadSummary(summaryNoHistory);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, expectedTree, false);\n\t\t\t\t});\n\n\t\t\t\tit('reads 0.0.2 files with history', async () => {\n\t\t\t\t\tconst { tree } = await setUp002Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_0_2);\n\t\t\t\t\tconst expectedTree = await setUp002SummaryTestTree(true);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, expectedTree);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe('reading next version', () => {\n\t\t\t\tit('reads 0.1.1', async () => {\n\t\t\t\t\tconst { tree } = await setUp002Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_1_1);\n\t\t\t\t\t// TODO: There may need to be a testObjectProvider synchronization here to upload\n\t\t\t\t\t// blobs from this summary.\n\t\t\t\t\t// We should also look at how this test asserts behavior w.r.t blobs.\n\t\t\t\t\tconst newSummary = JSON.parse(tree.saveSerializedSummary());\n\t\t\t\t\tconst expectedSummary = JSON.parse(summaryFileWithHistory_0_1_1);\n\t\t\t\t\texpect(newSummary).to.deep.equal(expectedSummary);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tit('gives correct SummaryStatistics', async () => {\n\t\t\t\tconst { tree } = await setUp002Tree({});\n\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_0_2);\n\t\t\t\tconst editCount = tree.edits.length;\n\t\t\t\tconst summary = deserialize(summaryFileWithHistory_0_0_2, testSerializer);\n\t\t\t\tconst telemetryInfo = getSummaryStatistics(summary);\n\t\t\t\tconst expectedTelemetryInfo: SummaryStatistics = {\n\t\t\t\t\tformatVersion: WriteFormat.v0_0_2,\n\t\t\t\t\thistorySize: editCount,\n\t\t\t\t};\n\t\t\t\texpect(telemetryInfo).to.deep.equals(expectedTelemetryInfo);\n\t\t\t});\n\t\t});\n\n\t\tdescribe('0.1.1 write format', () => {\n\t\t\tconst setUp011Tree: typeof setUpLocalServerTestSharedTree = async (options) =>\n\t\t\t\tsetUpLocalServerTestSharedTree({ writeFormat: WriteFormat.v0_1_1, ...options });\n\n\t\t\tconst setUp011SummaryTestTree = async (summarizeHistory: boolean): Promise<SharedTree> =>\n\t\t\t\tcreateSummaryTestTree(WriteFormat.v0_1_1, summarizeHistory);\n\n\t\t\tit('writes 0.1.1 files without history', async () => {\n\t\t\t\tconst tree = await setUp011SummaryTestTree(false);\n\t\t\t\tconst summary: RecursiveMutable<SharedTreeSummary> = JSON.parse(tree.saveSerializedSummary());\n\t\t\t\tconst expectedSummary: SharedTreeSummary = JSON.parse(summaryFileNoHistory_0_1_1);\n\t\t\t\t// The edit ID of the single \"no history edit\" is generated randomly. Replace it with the baseline edit for the sake of this test.\n\t\t\t\texpectDefined(summary.editHistory).editIds[0] = expectDefined(expectedSummary.editHistory?.editIds[0]);\n\t\t\t\texpect(summary).to.deep.equal(expectedSummary);\n\t\t\t});\n\n\t\t\tit('writes 0.1.1 files with history', async () => {\n\t\t\t\tconst tree = await setUp011SummaryTestTree(true);\n\t\t\t\texpect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(\n\t\t\t\t\tJSON.parse(summaryFileWithHistory_0_1_1)\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tdescribe('reading the same version', () => {\n\t\t\t\tit('reads 0.1.1 files without history', async () => {\n\t\t\t\t\tconst { tree } = await setUp011Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileNoHistory_0_1_1);\n\t\t\t\t\t// Tree should have exactly one edit, as all \"no history\" summaries do.\n\t\t\t\t\texpect(tree.edits.length).to.equal(1);\n\t\t\t\t\t// Load a baseline tree's own summary with no history to compare with\n\t\t\t\t\tconst summaryNoHistory = (await setUp011SummaryTestTree(false)).saveSummary();\n\t\t\t\t\tconst { tree: expectedTree } = await setUp011Tree({ summarizeHistory: false });\n\t\t\t\t\texpectedTree.loadSummary(summaryNoHistory);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, expectedTree, false);\n\t\t\t\t});\n\n\t\t\t\tit('reads 0.1.1 files with history', async () => {\n\t\t\t\t\tconst { tree } = await setUp011Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_1_1);\n\t\t\t\t\tconst expectedTree = await setUp011SummaryTestTree(false);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, expectedTree);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe('reading previous versions', () => {\n\t\t\t\tit('reads 0.0.2', async () => {\n\t\t\t\t\tconst expectedTree = await setUp011SummaryTestTree(true);\n\t\t\t\t\tconst { tree } = await setUp011Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_0_2);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, expectedTree);\n\t\t\t\t\texpect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(\n\t\t\t\t\t\tJSON.parse(summaryFileWithHistory_0_0_2)\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tit('upgrades 0.0.2', async () => {\n\t\t\t\t\tconst { tree, testObjectProvider } = await setUp011Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_0_2);\n\t\t\t\t\t// Synchronize to give a chance for the update op to be sequenced.\n\t\t\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\t\t\tconst expectedTree = await setUp011SummaryTestTree(true);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, expectedTree);\n\t\t\t\t\texpect(JSON.parse(tree.saveSerializedSummary())).to.deep.equal(\n\t\t\t\t\t\tJSON.parse(summaryFileUpgrade_0_1_1)\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tit('upgrades 0.0.2 that has several stale ops that it resubmits', async () => {\n\t\t\t\t\tconst { tree: resubmitTree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\t\t\t\t\twriteFormat: WriteFormat.v0_0_2,\n\t\t\t\t\t});\n\t\t\t\t\tapplyTestEdits(resubmitTree);\n\t\t\t\t\tconst { tree: tree } = await setUpLocalServerTestSharedTree({\n\t\t\t\t\t\twriteFormat: WriteFormat.v0_1_1,\n\t\t\t\t\t\ttestObjectProvider,\n\t\t\t\t\t});\n\t\t\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\t\t\tawait expectSharedTreesEqual(resubmitTree, tree);\n\t\t\t\t\tawait expectSharedTreesEqual(tree, await createSummaryTestTree(WriteFormat.v0_1_1, true));\n\t\t\t\t});\n\n\t\t\t\tit('Normalizes a denormalized summary containing nodes with empty traits', async () => {\n\t\t\t\t\tconst { tree } = await setUp011Tree({});\n\t\t\t\t\ttree.loadSerializedSummary(summaryFileEmptyTraits_0_0_2);\n\n\t\t\t\t\tconst { tree: expectedTree } = await setUp011Tree({});\n\t\t\t\t\texpectedTree.loadSerializedSummary(summaryFileWithHistory_0_0_2);\n\t\t\t\t\texpect(\n\t\t\t\t\t\tareRevisionViewsSemanticallyEqual(\n\t\t\t\t\t\t\ttree.currentView,\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\texpectedTree.currentView,\n\t\t\t\t\t\t\texpectedTree\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\tit('gives correct SummaryStatistics', async () => {\n\t\t\t\tconst { tree } = await setUp011Tree({});\n\t\t\t\ttree.loadSerializedSummary(summaryFileWithHistory_0_1_1);\n\t\t\t\tconst editCount = tree.edits.length;\n\t\t\t\tconst summary = deserialize(summaryFileWithHistory_0_1_1, testSerializer);\n\t\t\t\tconst telemetryInfo = getSummaryStatistics(summary);\n\t\t\t\tconst totalChunks = 1;\n\t\t\t\tconst expectedTelemetryInfo: SummaryStatistics = {\n\t\t\t\t\tformatVersion: WriteFormat.v0_1_1,\n\t\t\t\t\thistorySize: editCount,\n\t\t\t\t\ttotalNumberOfChunks: totalChunks,\n\t\t\t\t\tuploadedChunks: 0,\n\t\t\t\t};\n\t\t\t\texpect(telemetryInfo).to.deep.equals(expectedTelemetryInfo);\n\t\t\t});\n\t\t});\n\t});\n}\n\nasync function expectSharedTreesEqual(\n\tsharedTreeA: SharedTree,\n\tsharedTreeB: SharedTree,\n\tcompareEditIds = true\n): Promise<void> {\n\tif (\n\t\t!areRevisionViewsSemanticallyEqual(sharedTreeA.currentView, sharedTreeA, sharedTreeB.currentView, sharedTreeB)\n\t) {\n\t\texpect.fail('trees have different current views');\n\t}\n\n\tif (sharedTreeA.edits.length !== sharedTreeB.edits.length) {\n\t\texpect.fail('trees have different amounts of edits');\n\t}\n\n\tfor (let i = 0; i < sharedTreeA.edits.length; i++) {\n\t\tconst roundTrip = <T>(obj: T): T => JSON.parse(JSON.stringify(obj)) as T;\n\n\t\tconst editA = roundTrip(\n\t\t\tconvertEditIds(getEditLogInternal(sharedTreeA).tryGetEditAtIndex(i) ?? fail('edit not found'), (id) =>\n\t\t\t\tsharedTreeA.convertToStableNodeId(id)\n\t\t\t)\n\t\t);\n\t\tconst editB = roundTrip(\n\t\t\tconvertEditIds(getEditLogInternal(sharedTreeB).tryGetEditAtIndex(i) ?? fail('edit not found'), (id) =>\n\t\t\t\tsharedTreeB.convertToStableNodeId(id)\n\t\t\t)\n\t\t);\n\t\tif (compareEditIds) {\n\t\t\texpect(editA).to.deep.equal(editB, `trees have different edits (index ${i})`);\n\t\t} else {\n\t\t\texpect(editA.changes).to.deep.equal(editB.changes, `edits have different changes (index ${i})`);\n\t\t}\n\t}\n}\n\nfunction loadSummaryTestFiles(): {\n\tsummaryFileWithHistory_0_0_2: string;\n\tsummaryFileNoHistory_0_0_2: string;\n\tsummaryFileEmptyTraits_0_0_2: string;\n\tsummaryFileWithHistory_0_1_1: string;\n\tsummaryFileNoHistory_0_1_1: string;\n\tsummaryFileUpgrade_0_1_1: string;\n} {\n\tconst summaryFileWithHistory_0_0_2 = fs.readFileSync(join(directory, 'summary-0-0-2.json'), 'utf8');\n\tconst summaryFileNoHistory_0_0_2 = fs.readFileSync(join(directory, 'summary-no-history-0-0-2.json'), 'utf8');\n\tconst summaryFileEmptyTraits_0_0_2 = fs.readFileSync(join(directory, 'summary-empty-traits-0-0-2.json'), 'utf8');\n\tconst summaryFileWithHistory_0_1_1 = fs.readFileSync(join(directory, 'summary-0-1-1.json'), 'utf8');\n\tconst summaryFileNoHistory_0_1_1 = fs.readFileSync(join(directory, 'summary-no-history-0-1-1.json'), 'utf8');\n\tconst summaryFileUpgrade_0_1_1 = fs.readFileSync(join(directory, 'summary-upgrade-0-1-1.json'), 'utf8');\n\n\treturn {\n\t\tsummaryFileWithHistory_0_0_2,\n\t\tsummaryFileNoHistory_0_0_2,\n\t\tsummaryFileEmptyTraits_0_0_2,\n\t\tsummaryFileWithHistory_0_1_1,\n\t\tsummaryFileNoHistory_0_1_1,\n\t\tsummaryFileUpgrade_0_1_1,\n\t};\n}\n\nasync function makeSummaryTestFiles(): Promise<void> {\n\ttry {\n\t\tfs.accessSync(directory);\n\t} catch {\n\t\tfs.mkdirSync(directory);\n\t}\n\n\tconst treeWithHistory_0_0_2 = await createSummaryTestTree(WriteFormat.v0_0_2, true);\n\tconst treeNoHistory_0_0_2 = await createSummaryTestTree(WriteFormat.v0_0_2, false);\n\tconst treeWithHistory_0_1_1 = await createSummaryTestTree(WriteFormat.v0_1_1, true);\n\tconst treeNoHistory_0_1_1 = await createSummaryTestTree(WriteFormat.v0_1_1, false);\n\n\tfs.writeFileSync(join(directory, `summary-0-0-2.json`), treeWithHistory_0_0_2.saveSerializedSummary());\n\tfs.writeFileSync(join(directory, `summary-no-history-0-0-2.json`), treeNoHistory_0_0_2.saveSerializedSummary());\n\tfs.writeFileSync(join(directory, `summary-0-1-1.json`), treeWithHistory_0_1_1.saveSerializedSummary());\n\tfs.writeFileSync(join(directory, `summary-no-history-0-1-1.json`), treeNoHistory_0_1_1.saveSerializedSummary());\n\n\tconst { tree: upgradedTree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\twriteFormat: WriteFormat.v0_1_1,\n\t\tsummarizeHistory: true,\n\t});\n\tupgradedTree.loadSummary(treeWithHistory_0_0_2.saveSummary());\n\tawait testObjectProvider.ensureSynchronized();\n\tfs.writeFileSync(join(directory, `summary-upgrade-0-1-1.json`), upgradedTree.saveSerializedSummary());\n}\n\n/** Every instance of this class generates the same sequence of v5 UUIDs */\nclass DeterministicIdGenerator {\n\tpublic static readonly sessionId = '968bee41-bcf7-46d2-8035-6eb163b76c4c' as SessionId;\n\tprivate static readonly uuidNamespace = '44864298-500e-4cf8-9f44-a249e5b3a286';\n\tprivate editIdCount = 0;\n\tprivate readonly constantIdCompressor?: IdCompressor;\n\n\tpublic constructor(\n\t\tpublic readonly writeFormat: WriteFormat,\n\t\tprivate readonly sharedTree: SharedTree\n\t) {\n\t\tif (this.writeFormat === WriteFormat.v0_1_1) {\n\t\t\tassert(getIdNormalizerFromSharedTree(sharedTree).localSessionId === DeterministicIdGenerator.sessionId);\n\t\t} else {\n\t\t\tassert(getIdNormalizerFromSharedTree(sharedTree).localSessionId !== DeterministicIdGenerator.sessionId);\n\t\t\tthis.constantIdCompressor = new IdCompressor(DeterministicIdGenerator.sessionId, reservedIdCount);\n\t\t}\n\t}\n\n\tpublic getNextEditId(): EditId {\n\t\treturn v5((this.editIdCount++).toString(), DeterministicIdGenerator.uuidNamespace) as EditId;\n\t}\n\n\tpublic getNextNodeId(): NodeId {\n\t\treturn this.writeFormat === WriteFormat.v0_0_2\n\t\t\t? this.sharedTree.generateNodeId(this.getNextStableId())\n\t\t\t: this.sharedTree.generateNodeId();\n\t}\n\n\tprivate getNextStableId(): StableId {\n\t\tassert(this.constantIdCompressor !== undefined);\n\t\treturn this.constantIdCompressor.decompress(this.constantIdCompressor.generateCompressedId()) as StableId;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.tests.d.ts","sourceRoot":"","sources":["../../src/test/Transaction.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|