Open Nyan11 opened 1 year ago
Thanks for opening your first issue! Please check the CONTRIBUTING documents for some tips about which information should be provided. You can find information of how to do a Pull Request here: https://github.com/pharo-project/pharo/wiki/Contribute-a-fix-to-Pharo
GitHubPharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk. - pharo-project/pharo
Hello,
I was working on a project that involve the Clipboard and i have no idea how i can write a unit test with the clipboard.
My problem
I have a method that copy a text in the clipboard and i have to test if the text is present in the clipboard.
How do i know that the clipboard is ready ?
examples
All example are run in a playground.
short text and no delay
In this example i create a string "text" with 10 times $a in it.
Then i repeat 100 times the following:
I obtains the following results :
(The result are not always the same)
short text and a delay
I added a smal delay after setting my clipboard.
The results are :
(The result are not always the same)
long text and a delay
I added a small delay and a much longer text.
The results are :
(The result are not always the same).
Possible explanation
I use Microsoft Window and i think the "clipboard method" used by Pharo is the
SDL2 class >> #clipboardText:
(class side).The method send a ffiCall in
SDL2 class >> #primClipboardText:
.My questions ?
How can i know that the FFI call message has been sent and has been processed by my OS ?
If i know that the FFI call is send to the os and if i know that the OS has finish to copy the text, I could write a unit test to ensure the method i write copy the correct text to my clipboard.
other infos
OS: Window Pharo version : Pharo 11.0.0 Build info: Pharo-11.0.0+build.700.sha.53659ed8c20ddb4b644a58135325ff84be4e063e (64 Bit)