Re: [java-gnome-hackers] Failed tests run + LoremIpsum class location
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2012-08-13 23:19:37
|
On Mon, 2012-08-13 at 17:14 +0200, Sarah Leibbrand wrote:
> Ok so I ran the `make test` command and got it down to 3 errors within
> 2 test cases.
> It is kinda silly but my Enchant library doesn't know the 'en'
> dictionary. Instead it finds 6 en_XX (e.g. en_GB) dictionaries.
Hm. I think that must have to do with what back ends are actually
installed on the system. For whatever reason I have an "en" (in addition
to "en_CA", "en_GB", etc).
- if (tag.equals("en")) {
+ if (tag.equals("en") || tag.startsWith("en_")) {
Just change this to
if (tag.startsWith("en")) {
should cover all the bases.
But before we change
- result = Enchant.existsDictionary("en");
+ result = Enchant.existsDictionary("en") || Enchant.existsDictionary("en_GB") || Enchant.existsDictionary("en_US");
I'd really like to know why you're not finding "en". It's supposed to be
provided by something if there is an English dictionary present. And as
for this test case, the point was "a dictionary known to exist" and
asking for four options like that is messy. If we *do* have to do that,
then it should probably be in a helper function like:
result = Enchant.existsDictionary("en");
if (result != null) {
return result;
}
result = Enchant.existsDictionary("en_GB");
if (result != null) {
return result;
}
...
fail("Known good dictionary not found");
Still want to know why I have an "en" and you don't.
AfC
|