[squeak-dev] The Inbox: Collections-ct.885.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 9 12:35:36 UTC 2020


Christoph Thiede uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.885.mcz

==================== Summary ====================

Name: Collections-ct.885
Author: ct
Time: 9 April 2020, 2:35:32.800949 pm
UUID: ddccd842-af02-a448-91f7-7556c8c7bf43
Ancestors: Collections-dtl.884

Proposal for discussion: Add String >> #matches: for polymorphy with RxMatcher.

This allows you to pass patterns strings whereever a RxMatcher is expected. Furthermore, IMHO the name #matches: gives you a better intuition for a test selector than #match: does.

| password patterns |
patterns := { '.{8,}' asRegex. '*password*'. '.*\d.*' asRegex }.
password := Project uiManager requestPassword: 'Enter a fake password'.
self assert: (patterns allSatisfy: [:pattern | pattern matches: password]) description: 'Your password is not safe enough'.

=============== Diff against Collections-dtl.884 ===============

Item was added:
+ ----- Method: String>>matches: (in category 'comparing') -----
+ matches: text
+ 	"For polymorphy with RxMatcher."
+ 
+ 	^ self match: text!



More information about the Squeak-dev mailing list