File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 HeaderError,
1010 splitOutput,
1111 getRequestLogger,
12+ isAbsolutePosixPath,
13+ isAbsoluteWindowsPath,
1214} = require ( "../lib/util" ) ;
1315const { version } = require ( "../package.json" ) ;
1416
@@ -329,4 +331,24 @@ script.cgi`);
329331 ) ;
330332 } ) ;
331333 } ) ;
334+ describe ( "isAbsolutePosixPath" , ( ) => {
335+ it ( "should return true" , async ( ) => {
336+ assert . strictEqual ( isAbsolutePosixPath ( "/usr/bin/perl" ) , true ) ;
337+ } ) ;
338+ it ( "should return false" , async ( ) => {
339+ assert . strictEqual ( isAbsolutePosixPath ( "perl" ) , false ) ;
340+ assert . strictEqual ( isAbsolutePosixPath ( "usr/bin/perl" ) , false ) ;
341+ } ) ;
342+ } ) ;
343+ describe ( "isAbsoluteWindowsPath" , ( ) => {
344+ it ( "should return true" , async ( ) => {
345+ assert . strictEqual ( isAbsoluteWindowsPath ( "C:\\Program Files\\perl" ) , true ) ;
346+ assert . strictEqual ( isAbsoluteWindowsPath ( "C:/Program Files/perl" ) , true ) ;
347+ assert . strictEqual ( isAbsoluteWindowsPath ( "\\\\volume\\perl" ) , true ) ;
348+ } ) ;
349+ it ( "should return false" , async ( ) => {
350+ assert . strictEqual ( isAbsoluteWindowsPath ( "perl" ) , false ) ;
351+ assert . strictEqual ( isAbsoluteWindowsPath ( "Program Files\\perl" ) , false ) ;
352+ } ) ;
353+ } ) ;
332354} ) ;
You can’t perform that action at this time.
0 commit comments