Bug in MagmaCollectionReader size ?

Florian Minjat florian.minjat at gmail.com
Mon Aug 20 15:10:22 UTC 2007


Hi,
   I was toying around with the last beta version of magma in order to 
have all my tests green.
   And I think I found a bug in MagmaCollectionReader : if you add an 
element in a MagmaCollection without commit, sending the size message 
to the collection will count this non-committed element. But if you 
send the size message to a MagmaCollectionReader, it will not.
   Or it's a feature ?

   Here is the code of the test :

	session begin
	session root news add: un.
	session root news add: deux.
	session commitAndBegin.

	coll := (session root news read: #id descending: false).
	self assert: (coll size = coll collection asArray size). '=> 
assertion ok'
	
	"add without commit"
	session root add: trois inCollection: #news.

	coll := (session root news read: #id descending: false).
	self assert: (coll size = coll collection asArray size). '=> 
assertion fails'

Florian


More information about the Magma mailing list