Skip to content

Commit

Permalink
testConcurrentIsEmpty -> move to #SoilIndexedDictionaryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusDenker committed Oct 18, 2023
1 parent b6cd0ac commit eec1dbf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/Soil-Core-Tests/SoilIndexTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
18 changes: 18 additions & 0 deletions src/Soil-Core-Tests/SoilIndexedDictionaryTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit eec1dbf

Please sign in to comment.