From eec1dbfa963b6128d4fbba8c192fe5175ea766ff Mon Sep 17 00:00:00 2001 From: Marcus Denker Date: Wed, 18 Oct 2023 15:02:45 +0200 Subject: [PATCH] testConcurrentIsEmpty -> move to #SoilIndexedDictionaryTest --- src/Soil-Core-Tests/SoilIndexTest.class.st | 20 ------------------- .../SoilIndexedDictionaryTest.class.st | 18 +++++++++++++++++ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Soil-Core-Tests/SoilIndexTest.class.st b/src/Soil-Core-Tests/SoilIndexTest.class.st index 9d534505..684ac95c 100644 --- a/src/Soil-Core-Tests/SoilIndexTest.class.st +++ b/src/Soil-Core-Tests/SoilIndexTest.class.st @@ -71,26 +71,6 @@ SoilIndexTest >> testConcurrentDo [ ] -{ #category : #tests } -SoilIndexTest >> testConcurrentIsEmpty [ - | tx1 tx2 tx3 | - tx1 := soil newTransaction. - tx1 root: (SoilSkipListDictionary new - maxLevel: 8; - keySize: 16; - at: #one put: #onevalue; - yourself). - tx1 commit. - tx2 := soil newTransaction. - "After creating tx2 we open a concurrent transaction and add a key to - the dictionary which should be invisible to tx2" - tx3 := soil newTransaction. - tx3 root removeKey: #one. - tx3 commit. - self assert: tx2 root size equals: 0. - self assert: tx2 root isEmpty. -] - { #category : #tests } SoilIndexTest >> testConcurrentRemoveKey [ | tx1 tx2 tx3 | diff --git a/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st b/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st index 8295ef96..305d0a68 100644 --- a/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st +++ b/src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st @@ -179,6 +179,24 @@ SoilIndexedDictionaryTest >> testAtIndexWithTransaction [ ] +{ #category : #tests } +SoilIndexedDictionaryTest >> testConcurrentIsEmpty [ + | tx1 tx2 tx3 | + tx1 := soil newTransaction. + tx1 root: (dict + at: #one put: #onevalue; + yourself). + tx1 commit. + tx2 := soil newTransaction. + "After creating tx2 we open a concurrent transaction and add a key to + the dictionary which should be invisible to tx2" + tx3 := soil newTransaction. + tx3 root removeKey: #one. + tx3 commit. + self assert: tx2 root size equals: 0. + self assert: tx2 root isEmpty. +] + { #category : #tests } SoilIndexedDictionaryTest >> testDo [ | counter |