LocaleTest >> #testLocaleChanged

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

LocaleTest >> #testLocaleChanged

Frank Shearar-3
This test fails because there's a non-nil keyboardInterpreter.

It's never really worked. It's not at all clear why there's this code
setup/assertion before the actual test, either:

Project current updateLocaleDependents.
self assert: (ActiveHand instVarNamed: 'keyboardInterpreter') isNil
description: 'non-nil keyboardInterpreter'.
self assert: (Clipboard default instVarNamed: 'interpreter') isNil
description: 'non-nil interpreter'.

Given that ActiveHand's class, HandMorph, lazily constructs the
keyboardInterpreter instvar, I don't know why we bother to check it.

Also the test doesn't respect the current locale, failing to restore
the original locale.

I think the proper way to rewrite this test is to have a test fixture
class that simply stores a flag. Changing the locale causes this class
to store that its locale changed, and the test becomes "do things
respond to a locale change" by checking this flag. (This class might
as well be LocaleTest.)

Sound like a plan?

frank

Reply | Threaded
Open this post in threaded view
|

Re: LocaleTest >> #testLocaleChanged

timrowledge

On 12-01-2014, at 5:19 AM, Frank Shearar <[hidden email]> wrote:

> This test fails because there's a non-nil keyboardInterpreter.
>
> It's never really worked. It's not at all clear why there's this code
> setup/assertion before the actual test, either:
>
> Project current updateLocaleDependents.
> self assert: (ActiveHand instVarNamed: 'keyboardInterpreter') isNil
> description: 'non-nil keyboardInterpreter'.
> self assert: (Clipboard default instVarNamed: 'interpreter') isNil
> description: 'non-nil interpreter'.
>
> Given that ActiveHand's class, HandMorph, lazily constructs the
> keyboardInterpreter instvar, I don't know why we bother to check it.

Maybe there was some issue with it not getting nilled out? That’s all I can work out from it so far.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Fractured Idiom:- COGITO EGGO SUM - I think; therefore, I am a waffle