@@ -1591,13 +1591,29 @@ def test_selflink(self):
15911591class TestGlobPaths (unittest .TestCase ):
15921592 """Test `glob` paths."""
15931593
1594- def test_root (self ):
1594+ @unittest .skipUnless (not sys .platform .startswith ('win' ), "Linux/Unix specific test" )
1595+ def test_root_unix (self ):
15951596 """Test that `glob` translates the root properly."""
15961597
1597- # On Windows, this should translate to the current drive.
15981598 # On Linux/Unix, this should translate to the root.
15991599 # Basically, we should not return an empty set.
1600- self .assertTrue (len (glob .glob ('/*' )) > 0 )
1600+ results = glob .glob ('/*' )
1601+ self .assertTrue (len (results ) > 0 )
1602+ self .assertTrue ('/' not in results )
1603+
1604+ @unittest .skipUnless (sys .platform .startswith ('win' ), "Windows specific test" )
1605+ def test_root_win (self ):
1606+ """Test that `glob` translates the root properly."""
1607+
1608+ # On Windows, this should translate to the current drive.
1609+ # Basically, we should not return an empty set.
1610+ results = glob .glob ('/*' )
1611+ self .assertTrue (len (results ) > 0 )
1612+ self .assertTrue ('\\ ' not in results )
1613+
1614+ results = glob .glob (r'\\*' )
1615+ self .assertTrue (len (results ) > 0 )
1616+ self .assertTrue ('\\ ' not in results )
16011617
16021618 def test_start (self ):
16031619 """Test that starting directory/files are handled properly."""
0 commit comments