File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
main/java/com/cloudinary/transformation
test/java/com/cloudinary/transformation Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ private static Pattern getPattern() {
123123 sb .append (Pattern .quote (op )).append ("|" );
124124 }
125125 sb .deleteCharAt (sb .length () - 1 );
126- sb .append (")(?=[ _])|(?<!\\ $)(" ).append (StringUtils .join (PREDEFINED_VARS .keySet (), "|" )).append ("))" );
126+ sb .append (")(?=[ _])|(?<![ \\ $:] )(" ).append (StringUtils .join (PREDEFINED_VARS .keySet (), "|" )).append ("))" );
127127 pattern = sb .toString ();
128128 return Pattern .compile (pattern );
129129 }
Original file line number Diff line number Diff line change @@ -174,4 +174,16 @@ public void normalize_doesntReplaceVariable_8() {
174174 String actual = Expression .normalize ("$__height_100" );
175175 assertEquals ("$_height_100" , actual );
176176 }
177+
178+ @ Test
179+ public void normalize_duration () {
180+ String actual = Expression .normalize ("duration" );
181+ assertEquals ("du" , actual );
182+ }
183+
184+ @ Test
185+ public void normalize_previewDuration () {
186+ String actual = Expression .normalize ("preview:duration_2" );
187+ assertEquals ("preview:duration_2" , actual );
188+ }
177189}
You can’t perform that action at this time.
0 commit comments