[squeak-dev] The Inbox: Regex-Tests-Core-ct.29.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 5 09:08:56 UTC 2022


Christoph Thiede uploaded a new version of Regex-Tests-Core to project The Inbox:
http://source.squeak.org/inbox/Regex-Tests-Core-ct.29.mcz

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

Name: Regex-Tests-Core-ct.29
Author: ct
Time: 5 October 2022, 11:08:56.494956 am
UUID: 658d597e-3e45-0d4f-81fd-b444af6babfb
Ancestors: Regex-Tests-Core-mt.17

Complements Regex-Core-ct.77 (match reset).

=============== Diff against Regex-Tests-Core-mt.17 ===============

Item was added:
+ ----- Method: RxParserTest>>testMatchReset (in category 'tests') -----
+ testMatchReset
+ 
+ 	| matcher |
+ 	matcher := 'a\Kb' asRegex.
+ 	self assert: (matcher matches: 'ab').
+ 	self assert: 'b' equals: (matcher subexpression: 1).
+ 	
+ 	matcher := '((a+)\Kb+)' asRegex.
+ 	self assert: (matcher matches: 'aaabb').
+ 	self assert: 'bb' equals: (matcher subexpression: 1).
+ 	self assert: 'aaabb' equals: (matcher subexpression: 2).
+ 	self assert: 'aaa' equals: (matcher subexpression: 3).
+ 	
+ 	matcher := '([a-z]\K[A-Z])+' asRegex.
+ 	self assert: (matcher matches: 'aBcDeF').
+ 	self assert: #('F') equals: (matcher subexpressions: 1).
+ 	self assert: #('aB' 'cD' 'eF') equals: (matcher subexpressions: 2).
+ 	
+ 	matcher := '(a\Kb)' asRegex.
+ 	self deny: (matcher search: 'aa').
+ 	self assert: (matcher subexpressions: 1) isEmpty.
+ 	self assert: (matcher subexpressions: 2) isEmpty.!



More information about the Squeak-dev mailing list