[Pharo7] halt inside and outside tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo7] halt inside and outside tests

Sean P. DeNigris
Administrator
Denis Kudriashov wrote
>> I would even shorten it to haltIfTest and haltIfNotTest.

Sounds good.



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo7] halt inside and outside tests

Stephane Ducasse-3
In reply to this post by alistairgrant
We do not plan to remove self halt.
We plan to have better code expansion :) like ctrl sh => self halt :)

Stef

On Thu, Apr 5, 2018 at 7:26 AM, Alistair Grant <[hidden email]> wrote:

> On 4 April 2018 at 22:20, Peter Uhnák <[hidden email]> wrote:
>> If we remove self halt, then I won't be able to use `1halt.`. :-D which is
>> actually what I always do, because writing `self halt` is 4 characters tooo
>> long. :)
>>
>> On Wed, Apr 4, 2018 at 9:40 PM, Sean P. DeNigris <[hidden email]>
>> wrote:
>>>
>>> Peter Uhnák wrote
>>> > Would it be possible to instead have a #haltIf object to which you can
>>> > send
>>> > additional conditions?
>>>
>>> Maybe we could use that as an excuse to clean more halting out of object
>>> completely e.g.
>>> self halt now
>>> self halt once
>>> self halt ifInsideTest
>>> self halt ifOutsideTest
>>> self halt xyz
>>>
>>> Although IIRC when we first started cleaning the idea was too eventually
>>> remove all halt-related stuff from Object and only have `Halt xyz`. At the
>>> time, it seemed that was a little too scary, but even today I do not
>>> understand what objectively is gained by `self halt` vs. `Halt now`…
>
> One (very small) advantage of having 'self halt' is that a few times
> I've had a single, long, expression that I want to halt in, and since
> #halt returns self it is easy to insert it in the middle of an
> expression.
>
> Cheers,
> Alistair
>

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo7] halt inside and outside tests

Stephane Ducasse-3
In reply to this post by Marcus Denker-4
Marcus I think that the if is important because I had hard time to
understand how I should use it
and I proposed them.

On Thu, Apr 5, 2018 at 9:10 AM, Marcus Denker <[hidden email]> wrote:

>
>
> On 3 Apr 2018, at 21:56, Christophe Demarey <[hidden email]>
> wrote:
>
> Nice addition!
> I should say that names are not really intention revealing.
> What about haltIfTestExecutionEnvironment and
> haltIfDefaultExecutionEnvironment ?
>
> To long and too implementation centered.
>
> I would even shorten it to haltIfTest and haltIfNotTest.
>
> Le 2 avr. 2018 à 21:12, Marcus Denker <[hidden email]> a écrit :
>
> Hi,
>
> As we can not very easily decide if we are inside a test execution or not
> there was the idea to have special #halt messages
>
> https://pharo.fogbugz.com/f/cases/20151/new-halt-messages
>
> This PR implements them:
>
> https://github.com/pharo-project/pharo/pull/1177
>
> There is now #haltIfInsideTest and #haltfOutsideTest. In addition, the PR
> adds a helper method to make checking if the current
> execution environment is a test run a bit easier:
> "CurrentExecutionEnvironment value isTest”.
>
> Marcus
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo7] halt inside and outside tests

Marcus Denker-4
In reply to this post by Marcus Denker-4


On 5 Apr 2018, at 09:10, Marcus Denker <[hidden email]> wrote:



On 3 Apr 2018, at 21:56, Christophe Demarey <[hidden email]> wrote:

Nice addition!
I should say that names are not really intention revealing.
What about haltIfTestExecutionEnvironment and haltIfDefaultExecutionEnvironment ?

To long and too implementation centered. 

I would even shorten it to haltIfTest and haltIfNotTest.



I simplified them further and added test (will be in the next build)

Marcus
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo7] halt inside and outside tests

Stephane Ducasse-3
Thanks!!!!

On Tue, Apr 10, 2018 at 11:23 AM, Marcus Denker <[hidden email]> wrote:

>
>
> On 5 Apr 2018, at 09:10, Marcus Denker <[hidden email]> wrote:
>
>
>
> On 3 Apr 2018, at 21:56, Christophe Demarey <[hidden email]>
> wrote:
>
> Nice addition!
> I should say that names are not really intention revealing.
> What about haltIfTestExecutionEnvironment and
> haltIfDefaultExecutionEnvironment ?
>
> To long and too implementation centered.
>
> I would even shorten it to haltIfTest and haltIfNotTest.
>
>
> https://github.com/pharo-project/pharo/pull/1187/files
>
> I simplified them further and added test (will be in the next build)
>
> Marcus

12