[BUG] FileDirectory>>exists

Stephen Pair stephen at pairhome.net
Tue May 20 21:21:29 UTC 2003


>
>
>I'll leave it up to someone knowledgeable about this
>class to submit a test case which illustrates the
>expected behaviour on this last issue.
>
>  
>

Here's a test case that passes on Windows and on Linux (it's also 
attached as a fileout):

FileDirectoryTests>>testDirectoryExistsWhenLikeNamedFileExists

    | testFileName |
    [testFileName := self myAssuredDirectory fullNameFor: 
'zDirExistsTest.testing'.
    (FileStream newFileNamed: testFileName) close.

    self should: [FileStream isAFileNamed: testFileName].
    self shouldnt: [(FileDirectory on: testFileName) exists]]
        ensure: [self myAssuredDirectory deleteFileNamed: 
'zDirExistsTest.testing']


It should (IMO) be made to pass on the Mac as well.

- Stephen


-------------- next part --------------
'From Squeak3.4gamma of ''7 January 2003'' [latest update: #5168] on 20 May 2003 at 5:15:44 pm'!

!FileDirectoryTests methodsFor: 'existence tests' stamp: 'svp 5/20/2003 17:14'!
testDirectoryExistsWhenLikeNamedFileExists

	| testFileName |
	[testFileName := self myAssuredDirectory fullNameFor: 'zDirExistsTest.testing'.
	(FileStream newFileNamed: testFileName) close.

	self should: [FileStream isAFileNamed: testFileName].
	self shouldnt: [(FileDirectory on: testFileName) exists]]
		ensure: [self myAssuredDirectory deleteFileNamed: 'zDirExistsTest.testing']
! !


More information about the Squeak-dev mailing list