Wiki
Show
Ignore:
Timestamp:
03/06/10 05:14:42 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Minor improvement.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/Utils.cobra

    r2256 r2302  
    7676 
    7777        def pluralize(name as String) as String 
    78             # Could be made more sophisitcated in the future 
    79             return name + 's' 
     78            test 
     79                assert Utils.pluralize('bar') == 'bars' 
     80                assert Utils.pluralize('class') == 'classes' 
     81            body 
     82                return name + if(name.endsWith('s'), 'es', 's') 
    8083 
    8184        def toIdentifier(s as String) as String