[Seaside-dev] GRIntervalTest #testCopyUpToLast and #testCopyUpTo

Julian Fitzell jfitzell at gmail.com
Fri Jun 4 00:03:38 UTC 2010


Would probably be fine, but maybe more explicit to use
#keysAndValuesDo: on one and assert that each element matches with
#at: on the other?

Whatever you think is best; the use of #= is not essential to the test.

Julian

On Thu, Jun 3, 2010 at 11:13 PM, Dale Henrichs <dhenrich at vmware.com> wrote:
> 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
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>


More information about the seaside-dev mailing list