[stringtemplate-interest] Unit test failing on Windows

Gael Marziou gael.marziou at free.fr
Fri Nov 6 17:22:18 PST 2009


Here is a patch  that uses File.pathSeparator

   public PathGroupLoader(String dirStr, StringTemplateErrorListener 
errors) {
         this.errors = errors;
         StringTokenizer tokenizer = new StringTokenizer(dirStr, 
File.pathSeparator, false);
         while (tokenizer.hasMoreElements()) {
             String dir = (String) tokenizer.nextElement();
             if ( dirs==null ) {
                 dirs = new ArrayList();
             }
             dirs.add(dir);
         }
     }

The last test failing is testMultiDirGroupLoading().

Gael
> I understood why the testCannotFindInterfaceFile() unit test fails on
> Windows: the PathGroupLoader use ":" as path separator.
> Problem is that a directory in Windows uses this for drive letter.
> So when you get a directory "C:\Users\Gael\AppData\Local\Temp\", this
> code below considers as 2 parts : "c" and the remaining.
>
> Gael
>
>       public PathGroupLoader(String dirStr, StringTemplateErrorListener
> errors) {
>           this.errors = errors;
>           StringTokenizer tokenizer = new StringTokenizer(dirStr, ":",
> false);
>           while (tokenizer.hasMoreElements()) {
>               String dir = (String) tokenizer.nextElement();
>               if ( dirs==null ) {
>                   dirs = new ArrayList();
>               }
>               dirs.add(dir);
>           }
>       }
>
>
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
>
> __________ Information provenant d'ESET NOD32 Antivirus, version de la base des signatures de virus 4580 (20091106) __________
>
> Le message a été vérifié par ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>
>    





More information about the stringtemplate-interest mailing list