Faculty of Information Technology
Software Engineering Group

Opened 9 months ago

#255 new defect

Directory changed and when user eneters a file without path the file is stored in the default starting directory for Smalltalk/X

Reported by: Patrik Svestka Owned by:
Priority: major Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no

Description

I found out this issue when fixing #229.

If you change to a directory and then enter only a file name then the directory path is changed back to the default starting Smalltalk/X path. For me it is for example, C:\prg_sdk\stx8-jv_swing\build\stx\projects\smalltalk.

Here is a test to test it:

test_issue_next
    "Check if the file is stored in the correct directory after changing the default directory path

     Test saving file with same name as directory
        1. Create a temporary directory
        2. Pasting a String into a Workspace - to indicate what is going on
        3. Trying to save Workspace with ctrl + s 
        4. Changing to the temporary directory        
        5. Trying to save the file into the changed directory
        6. Check if it was saved into correct place
        7. Check if the directory was correctly deleted
    "
    | randomDirectoryPath pathToTest |

    randomDirectoryPath := Filename newTemporaryDirectory.
        
    pathToTest := (randomDirectoryPath asString, '\', 'testing') asFilename. 
    pathToTest recursiveMakeDirectory.   
    [ 
        textView contents: '''Testing directory vs. filename naming collision.'''.
        "/ trying to save the Workspace
        textViewInteractor type: #Ctrls.
        "/ selecting the path at the dialog screen
        textViewInteractor type: #ShiftHome.
        "/ saving directory path into the clipboard
        textView setClipboardText: pathToTest asString.
        
        "/ pasting the directory path and trying to change into the directory
        textViewInteractor type: #Paste.
        textViewInteractor type: #Return.

        "/ selecting the path back again
        textViewInteractor type: #ShiftHome.
        "/ typing a file names
        textViewInteractor type: 'WorkspaceFile.st'.
        "/ saving it
        textViewInteractor type: #Return.

        "/ the saved Workspace must exist at the changed path
        self assert: (pathToTest asString,'\','WorkspaceFile.st') asFilename exists.
        
    ] ensure: [ 
        randomDirectoryPath asFilename recursiveRemove.        
        self assert: randomDirectoryPath exists not
    ]

    "Created: / 11-12-2018 / 12:16:44 / svestkap"

Attachments (1)

WorkspaceApplicationTests-test_issue255.st (2.0 KB) - added by Patrik Svestka 9 months ago.
Test as fileOut

Download all attachments as: .zip

Change History (1)

Changed 9 months ago by Patrik Svestka

Test as fileOut

Note: See TracTickets for help on using tickets.