[Seaside-dev] GRIntervalTest #testCopyUpToLast and #testCopyUpTo
Dale Henrichs
dhenrich at vmware.com
Thu Jun 3 22:13:16 UTC 2010
GRIntervalTest inherits both #testCopyUpToLast and #testCopyUpTo (so the
tests are shared amongst a gob of tests). These two tests use #= when
validating the results of performing #copyUpTo: and #copyUpToLast: in an
Interval. In GemStone #= for SequenceableCollection requires that "the
two collections are of the same class". In the case of the test an Array
and an Interval are being compared and even though the interval is
correct, the test fails...
As far as I can tell, the use of #= is a side effect of the test and not
an explicit assertion that #= is expected to work on instances of
different subclasses of SequenceableCollection.
There is only one spot in each test where the problem occurs:
"no match"
self isUnique ifFalse: [
sub := collection copyUpToLast: self excludedElement.
self
assert: sub
validSequencedNewResponseFrom: collection.
self assert: sub size = collection size.
"====>" self assert: sub = collection ].
if the marked line above is changed to:
"====>" self assert: sub = collection asArray ].
The test passes in GemStone ... presumably it will pass elsewhere as well.
If there's no problem with changing the tests then I'll go ahead and
commit my changes (copy the two methods to GRIntervalTest with the
suggested changes).
Otherwise...
Dale
More information about the seaside-dev
mailing list