All,
One of the most impressive things I see about pier is the ability to
move pages around. A few days ago, I found that if I moved a page,
then edited it, all of the links on the page were broken. A three
page test would be:
root - Root has children *folder* and *command*
folder - Folder has a *parent>../.* and a *sibling/child>../
command*
command - Command has a *root>../.* and a *sibling/parent>../
folder*
If command is moved from being a child of root to being a child of
folder, then when it is edited, the link will not be updated to
*root>../..* and *sibling/parent>../..*.
If we add the following to the bottom of PRMoveCommand>>doExecute,
then it removes this problem:
self structure enumerator everything do: [:e |
(PROutgoingReferences on: e) do: [:link | link update ]]
This evening, I wrote a test case, and tested this with some older
code, but when I load Pier-model 300 and Pier tests 129, about a
dozen tests fail and there an issue with a DNU in
PRPathReference>>setTarget:, if someone is changing the Pier-Model,
could you add this test:
PRMoveCommandTest>>testMoveIntoFolderCheckContents
"Taken from #testMoveIntoFolder"
self command
target: (self command root childrenDecoration at: 'folder').
self kernel root contents: 'Before root has two children, *folder*
and *command*. After will be one child named folder, which has a
child command'.
(self kernel root childrenDecoration at: 'folder')
contents: 'Folder has a *parent>../* and a *sibling/child>../
command*.'.
(self kernel root childrenDecoration at: 'command')
contents: 'Command has a *root parent>../* and a *sibling/
parrent>../folder*.'.
self deny: (self kernel root enumerator everything
anySatisfy: [:e | (PROutgoingReferences on: e)
anySatisfy: [:link | link isBroken]]).
self
shouldnt: [self command execute]
raise: PRStructureError.
self
assert: (self command root contents includesSubString: 'two
children, *folder* and *folder/command*.').
self
assert: ((self command root childrenDecoration at: 'folder')
contents includesSubString: 'has a *parent>../* and a *sibling/
child>command*.').
self
assert: (((self command root childrenDecoration at: 'folder')
childrenDecoration at: 'command') contents includesSubString:
'Command has a *root parent>../..* and a *sibling/parrent>..*.')
Thanks,
John