[Pkg] Rio: File-Test-kph.8.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Mon Feb 23 01:15:28 UTC 2009


A new version of File-Test was added to project Rio:
http://www.squeaksource.com/Rio/File-Test-kph.8.mcz

==================== Summary ====================

Name: File-Test-kph.8
Author: kph
Time: 23 February 2009, 1:15:24 am
UUID: 7254a888-0147-11de-8efb-000a95edb42a
Ancestors: File-Test-test.7

+ started to add archive file system tests

=============== Diff against File-Test-test.7 ===============

Item was changed:
  ----- Method: FileVirtualFSCommonTest>>testBaseGet (in category 'tests-accessing') -----
  testBaseGet
  
  	self isKernelTest ifTrue: [ ^self ].
  	
  	self assert: self hello base = 'hello'.
  	self assert: self fullHello base = 'hello'.
+ 	self assert: self helloV5 base = 'hello'.
+ 	self assert: self helloFileUrl base = 'hello'.!
- 	self assert: self helloV5 base = 'hello'.!

Item was added:
+ ----- Method: FileArchiveExtractTest>>testArchiveContents (in category 'tests-archive') -----
+ testArchiveContents
+ 
+ 	| all |
+ 	
+ 	self makeArchive.
+ 	
+ 	self assert: (archive zip entries asSet = (Set with: (File new: 'testing_file'))).
+ 	
+ 	all := archive zip all entries.
+ 	
+ 	self assert: (all  asSet = 
+ 	
+ 	{ (File new: 'testing_file'). 
+ 	(File new: 'testing_file/t_a/f 1').
+ 	(File new: 'testing_file/t_a/f 2').
+ 	(File new: 'testing_file/t_a/t 1').
+ 	(File new: 'testing_file/t_a/t 2'). } asArray asOrderedCollection asSet).
+ 	
+ 	self assert: (all first isDirectory).
+ 	self assert: (all second isFile).
+ 	
+ 	!

Item was added:
+ ----- Method: FileArchiveExtractTest>>setUp (in category 'as yet unclassified') -----
+ setUp
+ 	
+ 	"the dir already exists"
+ 	"testDir mkdir"!

Item was added:
+ ----- Method: FileDirTest>>testFilesMatching (in category 'tests-select') -----
+ testFilesMatching
+ 
+ 	self makeDirectoriesAndFiles.
+ 	
+ 	self assert: (subDir filesMatching: 'f*') size = 2!

Item was added:
+ ----- Method: FileTest>>testEquality (in category 'tests') -----
+ testEquality
+ 	self assert: (File new: '/usr/bin/bob')
+ 			= '/usr/bin/bob'.
+ 	self assert: (File new: '/usr/bin/bob')
+ 			= (File new: '/usr/bin/bob')!

Item was added:
+ ----- Method: FileTest>>testFtp (in category 'tests') -----
+ testFtp
+ 	file := File new: 'ftp://ftp.seasidehosting.st'.
+ 	self assert: file class = Directory.
+ 	self assert: file executive class = FileFtpExecutive.!

Item was added:
+ ----- Method: FileArchiveExtractTest>>tearDown (in category 'as yet unclassified') -----
+ tearDown
+  
+ 	testDir file delete.
+ 	destDir all delete.!

Item was added:
+ ----- Method: FileArchiveExtractTest>>initialize (in category 'as yet unclassified') -----
+ initialize
+ 
+ 	testDir := 'testing_file.zip' asFile zip.
+ 	destDir := 'testing_file_dest' asDirectory.!

Item was added:
+ ----- Method: FileVirtualTestFSUnix class>>dirClass (in category 'as yet unclassified') -----
+ dirClass
+ 
+ 	^ Notification new tag: #dirClass; signal!

Item was added:
+ ----- Method: FileVirtualTestFSDos class>>dirClass (in category 'as yet unclassified') -----
+ dirClass
+ 
+ 	^ Notification new tag: #dirClass; signal!

Item was added:
+ FileDirTest subclass: #FileArchiveExtractTest
+ 	instanceVariableNames: 'archive'
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'File-Test'!
+ 
+ !FileArchiveExtractTest commentStamp: 'kph 4/9/2007 02:59' prior: 0!
+ How to work this archive thing?
+ 
+ In theory, a file ref in an archive should handle copyTo: to actually do the extraction.
+ How do you get a file ref in an archive?
+ 
+ One option would be:
+ 'myFile.zip' asRio zip entries 
+ 
+ Does this mean that on entering zip mode, our rio becomes the top level directory entry in a zipped filesystem?
+ The filesystem implements select: so all other select dependent facilities should work.
+ The mode adaptor could just override #executive, probably not sufficient.
+ ----
+ 
+ aDirectory addTree: (anArchive := aFile zip)
+ anArchive decompress => aDirectory addTree: anArchive
+ 
+ anArchive decompressTo: aDirectory.
+ aGzipFile decompressTo: aDirectory.!

Item was added:
+ ----- Method: FileArchiveExtractTest>>hmmm (in category 'as yet unclassified') -----
+ hmmm
+ "
+ aDirectory addTree: (anArchive := aFile zip)
+ anArchive decompress => aDirectory addTree: anArchive
+ 
+ anArchive decompressTo: aDirectory.
+ aGzipFile decompressTo: aDirectory.
+ "!

Item was added:
+ ----- Method: FileArchiveExtractTest>>testArchiveAccess (in category 'tests-archive') -----
+ testArchiveAccess
+ 
+ 	| file |
+ 	
+ 	self makeArchive.
+ 	
+ 	file := archive zip / 'testing_file/f_1'.
+ 	
+ 	self assert: (file isFile).
+ 	 !

Item was added:
+ ----- Method: FileVirtualFSDosFileTest>>testFromUrl (in category 'tests') -----
+ testFromUrl
+ 	 self assert: ((fileClass new: 'file:///E%3A/aa/bb/cc') asString = 'E:\aa\bb\cc' ).
+  
+ !

Item was added:
+ ----- Method: FileArchiveExtractTest class>>shouldInheritSelectors (in category 'as yet unclassified') -----
+ shouldInheritSelectors
+ 	^ true!

Item was added:
+ ----- Method: FileVirtualTestFSDos class>>fileClass (in category 'as yet unclassified') -----
+ fileClass
+ 
+ 	^ Notification new tag: #fileClass; signal!

Item was added:
+ ----- Method: FileVirtualFSCommonTest>>helloFileUrl (in category 'fixtures') -----
+ helloFileUrl
+ 	^ fileClass new: 'file:///hello.txt'!

Item was added:
+ ----- Method: FileTest>>testCwdAppendString (in category 'tests') -----
+ testCwdAppendString
+ 	| file2 |
+ 	file := File new.
+ 	file2 := file / 'user'.
+ 	self deny: file2 == file.
+ 	self assert: file2 asString = 'user'!

Item was added:
+ ----- Method: FileTest>>testExists (in category 'tests') -----
+ testExists
+ 	self assert: self thisImage exists.
+ 	self assert: self thisImage parent exists.
+ 	self deny: (self thisImage / 'blah') exists!

Item was added:
+ ----- Method: FileTest>>testHttp (in category 'tests') -----
+ testHttp
+ 	file := File new: 'http://www.google.com'.
+ 	self assert: file class = Directory.
+ 	self assert: file executive class = FileHttpExecutive!

Item was added:
+ ----- Method: FileArchiveExtractTest>>testAddFile (in category 'as yet unclassified') -----
+ testAddFile
+ 
+ 	self halt.
+ 	super testAddFile.!

Item was added:
+ ----- Method: FileDirTest>>testMatchingList (in category 'tests-select') -----
+ testMatchingList
+ 
+ 	self makeDirectoriesAndFiles.
+ 	
+ 	self assert: ('f*' asFile asMatchedList) size = 2!

Item was changed:
  ----- Method: FileDirTest>>testAddFile (in category 'tests-directory copying') -----
  testAddFile
  	 
  	| result |
+  
  	self makeDirectoriesAndFiles.
+ 
- 	
  	result := destDir mkpath add: (testDir / 't_a' / 'f 1').
  	
  	self assert: (destDir all entries size = 1).
  !

Item was added:
+ FileArchiveExtractTest subclass: #FileArchiveAddTest
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'File-Test'!

Item was added:
+ ----- Method: FileVirtualTestFSUnix class>>fileClass (in category 'as yet unclassified') -----
+ fileClass
+ 
+ 	^ Notification new tag: #fileClass; signal!

Item was added:
+ ----- Method: FileKernelTest>>helloFileUrl (in category 'fixtures') -----
+ helloFileUrl
+ 	^ fileClass new: 'file:///hello.txt'!

Item was added:
+ ----- Method: FileVirtualFSDosKernelTest>>helloFileUrl (in category 'fixture') -----
+ helloFileUrl
+ 	^ fileClass new: 'file:///D:/hello.txt'!

Item was changed:
  ----- Method: FileDirTest>>makeDirectoriesAndFiles (in category 'fixtures') -----
  makeDirectoriesAndFiles
  	 
  	subDir := (testDir / 't_a') mkdir.
+ 	 
- 	
  	a := (subDir / 'f 1') contents: 'test file'.
  	b := (subDir / 'f 2') contents: 'test file2'.
  	
  	"test dirname with space in it"
  	c := (subDir / 't 1') mkdir.
  	d := (subDir / 't 2') mkdir.
+ 	
+ 	testDir commit.
  
  	
  	!

Item was added:
+ ----- Method: FileArchiveExtractTest>>makeArchive (in category 'fixtures') -----
+ makeArchive
+  
+ 	self makeDirectoriesAndFiles.
+  
+ 	(archive := destDir mkdir / 'test.zip') zip addTree: testDir; commit.
+ 	 	
+ 	 !

Item was changed:
  ----- Method: FileTest>>testFull (in category 'tests') -----
  testFull
  	
+ 	file := Directory new.
- 	file := File new.
  	self assert: file full = FileDirectory default pathName.!

Item was removed:
- FileDirTest subclass: #FileArchiveTest
- 	instanceVariableNames: 'archive'
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'File-Test'!
- 
- !FileArchiveTest commentStamp: 'kph 4/9/2007 02:59' prior: 0!
- How to work this archive thing?
- 
- In theory, a file ref in an archive should handle copyTo: to actually do the extraction.
- How do you get a file ref in an archive?
- 
- One option would be:
- 'myFile.zip' asRio zip entries 
- 
- Does this mean that on entering zip mode, our rio becomes the top level directory entry in a zipped filesystem?
- The filesystem implements select: so all other select dependent facilities should work.
- The mode adaptor could just override #executive, probably not sufficient.
- ----
- 
- aDirectory addTree: (anArchive := aFile zip)
- anArchive decompress => aDirectory addTree: anArchive
- 
- anArchive decompressTo: aDirectory.
- aGzipFile decompressTo: aDirectory.!

Item was removed:
- ----- Method: FileTest>>http (in category 'tests') -----
- http
- 	file := File new: 'http://www.google.com'.
- 	self assert: file class = Directory.
- 	self assert: file executive class = FileHttpExecutive!

Item was removed:
- ----- Method: FileArchiveTest>>makeArchive (in category 'fixtures') -----
- makeArchive
-  
- 	self makeDirectoriesAndFiles.
-  
- 	(archive := destDir mkdir / 'test.zip') zip addTree: testDir; commit.
- 	 	
- 	 !

Item was removed:
- ----- Method: FileArchiveTest>>testArchiveContents (in category 'tests-archive') -----
- testArchiveContents
- 
- 	| all |
- 	
- 	self makeArchive.
- 	
- 	self assert: (archive zip entries asSet = (Set with: (File new: 'testing_file'))).
- 	
- 	all := archive zip all entries.
- 	
- 	self assert: (all  asSet = 
- 	
- 	{ (File new: 'testing_file'). 
- 	(File new: 'testing_file/t_a/f 1').
- 	(File new: 'testing_file/t_a/f 2').
- 	(File new: 'testing_file/t_a/t 1').
- 	(File new: 'testing_file/t_a/t 2'). } asArray asOrderedCollection asSet).
- 	
- 	self assert: (all first isDirectory).
- 	self assert: (all second isFile).
- 	
- 	!

Item was removed:
- ----- Method: FileTest>>cwdAppendString (in category 'tests') -----
- cwdAppendString
- 	rio := File new.
- 	newRio := rio / 'user'.
- 	self deny: newRio == rio.
- 	self assert: newRio asString = 'user'!

Item was removed:
- ----- Method: FileTest>>ftp (in category 'tests') -----
- ftp
- 	file := File new: 'ftp://ftp.seasidehosting.st'.
- 	self assert: file class = Directory.
- 	self assert: file executive class = FileFtpExecutive.!

Item was removed:
- ----- Method: FileTest>>full (in category 'tests') -----
- full
- 	
- 	dir := Directory new.
- 	self assert: dir full = FileDirectory default pathName.!

Item was removed:
- ----- Method: FileArchiveTest>>hmmm (in category 'as yet unclassified') -----
- hmmm
- "
- aDirectory addTree: (anArchive := aFile zip)
- anArchive decompress => aDirectory addTree: anArchive
- 
- anArchive decompressTo: aDirectory.
- aGzipFile decompressTo: aDirectory.
- "!

Item was removed:
- ----- Method: FileArchiveTest>>testArchiveAccess (in category 'tests-archive') -----
- testArchiveAccess
- 
- 	| file |
- 	
- 	self makeArchive.
- 	
- 	file := archive zip / 'testing_file/f_1'.
- 	
- 	self assert: (file isFile).
- 	 !

Item was removed:
- ----- Method: FileTest>>exists (in category 'tests') -----
- exists
- 	self assert: self thisImage exists.
- 	self assert: self thisImage parent exists.
- 	self deny: (self thisImage / 'blah') exists!

Item was removed:
- ----- Method: FileTest>>equality (in category 'tests') -----
- equality
- 	self assert: (File new: '/usr/bin/bob')
- 			= '/usr/bin/bob'.
- 	self assert: (File new: '/usr/bin/bob')
- 			= (File new: '/usr/bin/bob')!



More information about the Packages mailing list