Added test to improve #makeUniqueImageName:among:
MODIFY
src/PharoLauncher-Tests-Core.package/PhLDirectoryBasedImageGroupTest.class/instance/testMakeUniqueImageName.st
src/PharoLauncher-Tests-Core.package/PhLDirectoryBasedImageGroupTest.class/instance/testMakeUniqueImageName.st
tests-action
testMakeUniqueImageName
- | group groupNames |
- group := self emptyGroup. "Only for calling the method. It does not touch object state."
- groupNames := { }.
- { { '30444' . { } . '30444' } .
- { '30444' . { 'test' } . '30444' } .
- { '30444' . { 'test' . '30444' } . '30444-01' } .
- { '30444' . { 'test' . '30444' . '30444-01' } . '30444-02' } .
- { '30444' . { 'test' . '30444' . '30444-01' . '30444-02' } . '30444-03' } .
- { '30444' . { 'test' . '30444' . '30444-01' . '30444-09' } . '30444-10' } .
- { '30444' . { 'test' . '30444' . '30444-11' . '30444-09' } . '30444-12' } .
+
+ {
+ " { basename . expectedResult . {existingNames} } "
+ { '30444' . '30444' . { } } .
+ { '30444' . '30444' . { 'test' } } .
+ { '30444' . '30444-01' . { 'test' . '30444' } } .
+ { '30444' . '30444-02' . { 'test' . '30444' . '30444-01' } } .
+ { '30444' . '30444-03' . { 'test' . '30444' . '30444-01' . '30444-02' } } .
+ { '30444' . '30444-10' . { 'test' . '30444' . '30444-01' . '30444-09' } } .
+ { '30444' . '30444-12' . { 'test' . '30444' . '30444-11' . '30444-09' } } .
+ { '30444' . '30444-12' . { 'test' . '30444' . '30444-11' . '30444-09' . '30444-test' . '30644-Case12954' } } .
} do:
- [ :asn | | basename existingNames expectedResult result |
- basename := asn first.
- existingNames := asn second.
- expectedResult := asn third.
- result := group makeUniqueImageName: basename among: existingNames.
+ [ :testdata |
+ | basename expectedResult existingNames result |
+ basename := testdata first.
+ expectedResult := testdata second.
+ existingNames := testdata third.
+
+ result := self emptyGroup makeUniqueImageName: basename among: existingNames.
self assert: result equals: expectedResult.
]

Added test to improve #makeUniqueImageName:among:
https://pharo.fogbugz.com/f/cases/12533