[squeak-dev] The Trunk: Regex-Tests-Core-ct.32.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 12 13:43:55 UTC 2022


Christoph Thiede uploaded a new version of Regex-Tests-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Tests-Core-ct.32.mcz

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

Name: Regex-Tests-Core-ct.32
Author: ct
Time: 12 October 2022, 3:43:55.590412 pm
UUID: a5d9868e-f796-6741-940e-fb354d590aea
Ancestors: Regex-Tests-Core-ct.31

Complements Regex-Core-ct.84 (ordering of keyed subexpression ranges).

=============== Diff against Regex-Tests-Core-ct.31 ===============

Item was changed:
  ----- Method: RxMatcherTest>>testKeyedSubexpressions (in category 'testing-protocol') -----
  testKeyedSubexpressions
  
  	{
  		#('abc' () ()).
  		#('(\w)+' () ()).
  		{'(?<foo>a)b(c)'. #(foo ('a')). {#foo. {1 to: 1}}}.
  		{'(?<foo>\w+)'. #(foo ('abc')). {#foo. {1 to: 3}}}.
  		{'(?<foo>\w)+'. #(foo ('a' 'b' 'c')). {#foo. {1 to: 1. 2 to: 2. 3 to: 3}}}.
+ 		{'(?<foo>((?<foo>b)|(?<foo>[^b]))+)'. #(foo ('a' 'b' 'c' 'abc' )). {#foo. {1 to: 1. 2 to: 2. 3 to: 3. 1 to: 3}}}.
  		#('abc(?<foo>\w)?' (foo ()) (foo ()))
  	} do: [:spec |
  		| matcher |
  		matcher := spec first asRegex.
  		self assert: (matcher matches: 'abc').
  		self
  			assert: (Dictionary newFromPairs: spec second)
  			equals: matcher allKeyedSubexpressions.
  		self
  			assert: (Dictionary newFromPairs: spec third) associations
  			equals:
  				(matcher keyedMarkers collect:
  					[:key | key -> (matcher keyedSubexpressionRanges: key) asArray])].!



More information about the Squeak-dev mailing list