[squeak-dev] LocaleTest >> #testLocaleChanged

Frank Shearar frank.shearar at gmail.com
Sun Jan 12 13:19:28 UTC 2014


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


More information about the Squeak-dev mailing list