Our tests for #beginsWithSubCollection: and #endsWithSubCollection: with empty arguments fail on the latest Pharo and Squeak versions. It looks like they changed the behavior of #beginsWith: and #endsWith:
The current expectation seems to be based on ANSI #indexOfSubCollection:startingAt: which states
Answer 0 if no such subsequence is found in the receiver, or if targetSequence is empty.
An illustrative example
#(1 2 3) beginsWithSubCollection: #(1). "true"
#(1 2 3) beginsWithSubCollection: #(). "false in Pharo 10 and Squeak
5, true in Pharo 11 and Squeak 6 "
#(1 2 3) endsWithSubCollection: #(3). "true"
#(1 2 3) endsWithSubCollection: #(). "false in Pharo 10 and Squeak 5,
true in Pharo 11 and Squeak 6 "
There are several possible solutions, the ones with the least chance of blast damage seem to be:
- remove the empty argument tests, we don't seem to have any senders with empty arguments
- introduce
#greaseBeginsWithSubCollection: and #greaseEndsWithSubCollection;
See http://lists.squeakfoundation.org/pipermail/seaside-dev/2022-September/007363.html
Our tests for
#beginsWithSubCollection:and#endsWithSubCollection:with empty arguments fail on the latest Pharo and Squeak versions. It looks like they changed the behavior of#beginsWith:and#endsWith:The current expectation seems to be based on ANSI
#indexOfSubCollection:startingAt:which statesAn illustrative example
There are several possible solutions, the ones with the least chance of blast damage seem to be:
#greaseBeginsWithSubCollection:and#greaseEndsWithSubCollection;See http://lists.squeakfoundation.org/pipermail/seaside-dev/2022-September/007363.html