--- a/RegressionTests__StringTests.st Tue Aug 20 09:46:37 2019 +0200
+++ b/RegressionTests__StringTests.st Tue Aug 20 09:50:30 2019 +0200
@@ -2093,7 +2093,7 @@
test82f_expanding
"special cases:"
- | rslt |
+ | rslt args |
rslt := '%' bindWith:'aaa'.
self assert:(rslt = '%').
@@ -2122,6 +2122,21 @@
rslt := 'hello %(1)x' expandPlaceholders:$% with:{ 'x1' . 'x2' . 'x3' . 'x4' . 'x5' . 'x6' . 'x7' . 'x8' . 'x9' . 'x10' }.
self assert:(rslt = 'hello x1x').
+ args := Dictionary new
+ at:'year' put:'yyyy';
+ at:'mon' put:'mmm';
+ at:'day' put:'dd';
+ at:'h' put:'HH';
+ at:'m' put:'MM';
+ at:'s' put:'SS';
+ at:'i' put:'II';
+ yourself.
+
+ rslt := '%(year)-%(mon)-%(day) %h:%m:%s.%i' bindWithArguments:args.
+ self assert:(rslt = 'yyyy-mmm-dd HH:MM:SS.II').
+ rslt := '%(year)-%(mon)-%(day) %(h):%(m):%(s).%(i)' bindWithArguments:args.
+ self assert:(rslt = 'yyyy-mmm-dd HH:MM:SS.II').
+
self should:[ rslt := '%(' bindWith:'aaa' ] raise:Error.
!