NewTools
NewTools copied to clipboard
Now testSelectedEntriesMultipleSelection fails
The problem is that SpMultipleSelectionModeis comparing FileReference's using identity. When using ==, you're checking if two FileReference objects are the same object in memory. For FileReferences, this will often return false, even when referring to the same file, because each time you create a FileReference (even for the same path), a new object is instantiated:
| rootFS file1 |
rootFS := FileSystem memory.
file1 := (rootFS / 'file1.txt') ensureCreateFile.
(rootFS / 'file1.txt') == file1.
To reproduce, step into the following method:
Question: Should SpCollectionListModel>>#indexOf:ifAbsent: use indexOf:ifAbsent: instead of identityIndexOf: anItem ifAbsent: aBlock at least for comparing FileReferences?