[Kmymoney-devel] csvimport plugin test is translation dependent

Thomas Baumgart thb at net-bembel.de
Fri Sep 17 07:38:28 CEST 2010


Hi,

on Friday 17 September 2010 allan wrote:



> On 16/09/10 23:39, Alvaro Soliverez wrote:
> > On Thu, Sep 16, 2010 at 6:47 PM, allan <aganderson at ukonline.co.uk> wrote:
> >> On 16/09/10 18:45, Cristian Oneţ wrote:
> >>> 2010/9/16 Alvaro Soliverez <asoliverez at kde.org>:
> >>>> Comment out the short month test for now.
> >>>>
> >>>> Anyway, the test is inherently translation dependent, but it is
> >>>> supposed to work ok. That is, until someone screwed up when
> >>>> translating to Romanian. :/
> >>>
> >>> I've done that but if it can't be rewritten in a translation
> >>> independent manner I would prefer to remove it.
> >>
> >> As I see it, a test on the validity of an alpha month has to reflect the
> >> current locale, so has to involve translation. Â It would seem that the
> >> test was valid, but the translation was not, if I understand correctly.
> >> Â Presumably in real use, a valid short date month would be rejected, or
> >> perhaps just the one I chose at random?
> >>
> >> I contemplated leaving the test just commented out, for possible future
> >> inclusion once the translation is fixed, but the same could happen
> >> again. Â It was meant to be a test of convdate() rather than
> >> translation, so I'll remove it totally.
> >>
> >> Out of interest, what happens with the later test
> >> QLatin1String("13-rubbishmonth-2000")?
> >
> > I agree that the test has to include translation. I'd give time to fix
> > the issue in Romanian translation, but the test should go in.
> > If it fails we can check why that is, and report upstream if needed.
> >
> > Leave it commented for the moment, but IMHO the test is ok and it has to
> > stay.
> 
> I'd already taken it out, but it's back in now, commented out.  Unit
> tested again

Please keep in mind that an importer should not only be able to read the 
locale dependant form but also generic (english/non-localized?) forms at the 
same time. I ran into the same problem with the QIF importer once when using 
the German localization and getting data from a bank with english (non-
localized) month names. And that could happen all the time, so we better are 
prepared.

OK, this might be somewhat unrelated ot the subject of unit tests but I just 
wanted to mention it.
 
-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
BTW, just the planning of the test cases helped me
to improve the code a lot. -- Alvaro Soliverez
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 224 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100917/b46fbe9b/attachment.sig 


More information about the KMyMoney-devel mailing list