[Cuis-dev] Fix for test failures on Windows

Weslleymberg Lisboa weslleym.lisboa at gmail.com
Fri Mar 14 20:42:44 PDT 2025


Hi,

Test runs on Windows returns two failures:

1. FileManTest>>testDefaultDirectory which was fixed changing 
FileIOAccessor>>absolutePathComponentsFor:relativeTo: to include the 
drive letter in the returned path.

2. FileManTest>>testRecursiveDelete which was fixed by removing the 
colon from the test path. The colon was causing a primitive method from 
FilePlugin to fail.

Change sets attached.

I dont know how these changes affect Unix systems, but it should not 
cause problems.
-- 
Wéslleymberg Lisboa
Graduado em Sistemas de Informação
Docente no IFFluminense - Campus Itaboraí
-------------- next part --------------
'From Cuis7.3 [latest update: #7069] on 14 March 2025 at 10:53:54 pm'!

!FileIOAccessor methodsFor: 'utilities' stamp: 'wbsl 3/14/2025 15:38:50'!
absolutePathComponentsFor: aString relativeTo: baseDirectory
	"aString is a relative path, and will be applied to baseDirectory
	See comment at #isAbsolutePathName"

	| baseDirectoryPathComponents tokens |

	baseDirectoryPathComponents := {baseDirectory drive}, baseDirectory pathComponents.
	aString = '.' ifTrue: [ ^ baseDirectoryPathComponents ].
	aString = '..' ifTrue:  [^ baseDirectoryPathComponents allButLast ].

	tokens := aString asPathTokens.
	[ tokens notEmpty and: [ tokens first = '..' ]] whileTrue: [
		baseDirectoryPathComponents := baseDirectoryPathComponents allButLast.
		tokens removeFirst ].

	^ Array streamContents: [ :strm |
		strm nextPutAll: baseDirectoryPathComponents.
		tokens do: [ :each |
			each = '.' ifFalse: [ strm nextPut: each ]]].! !

-------------- next part --------------
'From Cuis7.3 [latest update: #7070] on 14 March 2025 at 11:29:19 pm'!

!FileManTest methodsFor: 'testing' stamp: 'wbsl 3/14/2025 23:27:03'!
testRecursiveDelete
	"FileManTest debug: #testRecursiveDelete" 
	| dir |
	dir := ('./subDir' asDirectoryEntry / 'aaa\bbb' / 'ccc' / 'ddd\eee' / 'fff\ggg').
	dir at: 'test1' put: 'RecursiveDelete!!'.
	self should: [(dir at: 'test1') = 'RecursiveDelete!!'].

	dir removeKey: 'test1'.

	self shouldnt: [(dir // 'test1') exists].

	'./subDir' asDirectoryEntry recursiveDelete.
	self shouldnt: [dir exists].
	self shouldnt: ['./subDir' asDirectoryEntry exists].

	! !



More information about the Cuis-dev mailing list