@echo off rem ============================================================================ rem testFilenamePattern.bat rem Test driver for class 'FilenamePattern'. rem rem ============================================================================ rem @(#)tribble/util/testFilenamePattern.bat $Date: 2008/10/10 22:00:15 $ rem ============================================================================ :setup set JAVA=java set CLASS=tribble.util.FilenamePattern$Test REM set CP=classes set CP=..\..\classes set CMD=%JAVA% -cp %CP% %CLASS% :test echo on @if not (%1) == () goto %1 :closure %CMD% "" a m %CMD% "*" "" f %CMD% "*" a t %CMD% "*" abc t %CMD% "*" abbbbbbbbbbc t %CMD% "a*" "" f %CMD% "a*" a t %CMD% "a*" aa t %CMD% "a*a" aa t %CMD% "a*b" ab t %CMD% "a*b" abb t %CMD% "*?" abbbbbbbbbbc t %CMD% "?*" abbbbbbbbbbc t %CMD% "?*" a t %CMD% "*?" a t %CMD% "*?" ab t %CMD% "?*" ab t %CMD% "*" abc/x f %CMD% "*" /abc f %CMD% "**" "" f (future) %CMD% "**" a t (future) %CMD% "**" ab t (future) %CMD% "**" abc t (future) %CMD% "**z" abcz t (future) %CMD% "**z" abcy f (future) %CMD% "/**" / f (future) %CMD% "/**" /a t (future) %CMD% "/**" /ab t (future) %CMD% "/**" /abc t (future) %CMD% "/**z" /abcz t (future) %CMD% "/**z" /abcy f (future) @if not (%1) == () goto end :set %CMD% "[" a m %CMD% "[a]" a t %CMD% "[aA]" a t %CMD% "[B]" b t %CMD% "[b]" B t %CMD% "[a" a m %CMD% "[a\]" a m %CMD% "x[a\]]" "x]" t %CMD% "[a\\]" a t %CMD% "[a\\]]" "a]" t %CMD% "x[a\-]" x- t %CMD% "[a-]" a m %CMD% "[a-" a m %CMD% "[a-z" a m %CMD% "[a-z]" h t %CMD% "[a-z]" G t %CMD% "[z-a]" G f %CMD% "[a-\z]" G t %CMD% "[a\-z][a\-z]" a- t %CMD% "[a-ghi-z]" h t %CMD% "x[a-z-]" x- m %CMD% "x[a-z\-]" xa t %CMD% "x[a-z\-]" x- t %CMD% "x[a-z\\]" x\ t %CMD% "x[a-z\\-]" x\ m %CMD% "x[/]b" x/b t %CMD% "/x[/]b/c" \x/b\c t @if not (%1) == () goto end :notset %CMD% "[^" a m %CMD% "[^]" a m %CMD% "[^a" h m %CMD% "[^a]" h t %CMD% "[^a-" h m %CMD% "[^a-]" h m %CMD% "[^a-u]" x t @if not (%1) == () goto end :negate %CMD% "!" x m %CMD% "!!" x m %CMD% "!*" "" f %CMD% "!*" xyz f %CMD% "!!*" xyz t %CMD% "!abc" abc f %CMD% "!abx" abc t %CMD% "!a*" xyz t %CMD% "!a*" abc f %CMD% "!*.c" foo.c f %CMD% "!*.c" foo.java t %CMD% "a!*b*" axbcx f %CMD% "a!*b*" axzcx t %CMD% "*!*" "" f %CMD% "*!*" a t %CMD% "!*!*" a f %CMD% "a!*!*" a t %CMD% "a![0-9]" a7 f %CMD% "a![0-9]" ax t %CMD% "a![0-9]" axe t %CMD% "[0-9]!z" 3z f %CMD% "[0-9]!z" 3x t %CMD% "[0-9]!z" dz f %CMD% "a![0-9]!z" a3z t %CMD% "a![0-9]!z" a3x f %CMD% "a![0-9]!z" adz t %CMD% "a![0-9]!z" adx t %CMD% "a!*b!*c" axyz t %CMD% "a!*b!*c" abc t %CMD% "a!*b!*z" abc f @if not (%1) == () goto end :dirsep %CMD% "/" / t %CMD% "/" // t %CMD% "//" // t %CMD% "/" /b f %CMD% "/" a/ f %CMD% "/*" / f %CMD% "/*" // f %CMD% "/?*" / f %CMD% "/*?" / f %CMD% "/*" /a t %CMD% "/*" //a t %CMD% "a/b" a/b t %CMD% "a/b" a\b t %CMD% "a/b" a//b t %CMD% "a/b" a\\b t %CMD% "a/b" a/////b t %CMD% "a/b" a\\\\\b t %CMD% "a//b" a//b t %CMD% "a///b" a///b t %CMD% "a///b" a//b f %CMD% "a//b" a/b f %CMD% "a///b" a/b f %CMD% "a//b" a/b f %CMD% "a/" a/ t %CMD% "a/" a// t %CMD% "a//" a/ f %CMD% "a//" a// t %CMD% "a//" a/// t %CMD% "/b" /b t %CMD% "/b" //b t %CMD% "//b" /b f %CMD% "//b" //b t %CMD% "//b" ///b t %CMD% "/*" /abc t %CMD% "/*" //abc t %CMD% "*/" / f %CMD% "*/a" /a f %CMD% "*/a" x/a t %CMD% "*?/a" /a f %CMD% "*?/a" x/a t %CMD% "*/a" xxxx/a t %CMD% "*z/a" xxxxz/a t %CMD% "*z*/a" xxzxx/a t %CMD% "*z*/a" xxz/a t %CMD% "/*/a" /xxxx/a t %CMD% "/*/a" //a f %CMD% "/*/*/a" /xxxx/b/a t %CMD% "*/*/a" xxxx//a f %CMD% "*/*/a" xxxx//b/a t %CMD% "*/*/a" xxxx/a/b f %CMD% "*/*/a" xxxx/c/b/a f %CMD% "a/b/z" a/b/z t %CMD% "a/bc/z" a/bc/z t %CMD% "a/b*/z" a/b/z t %CMD% "a/b*/z" a/bc/z t %CMD% "a/b*/z" a/bcd/z t %CMD% "a/b**/z" a/bcd/z t (future) %CMD% "a/**/z" a/b/z t (future) %CMD% "a/**/z" a/bcd/z t (future) %CMD% "a\/b" a/b t @if not (%1) == () goto end :url %CMD% "http://*" http://david.tribble.com t %CMD% "file://*/*" file:///C:/src t %CMD% "file://*" file:///C:/src f @if not (%1) == () goto end @echo off :end