Ticket #153 (assigned defect)
Regression test problems re tests with CultureInfo assumptions
Reported by: | Chuck | Owned by: | jonathandavid |
---|---|---|---|
Priority: | major | Milestone: | Cobra 0.9 |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
Reported by jonathandavid:
About the failing tests:
So far I've been able to fix the following ones:
(29) 062-string-substitution.cobra
(85) 120-primitive-type-members.cobra
(101) 310-primitive-members.cobra
(133) 510-number-parse.cobra
(267) 100-number-float32.cobra
(269) 100-number-float64.cobra
(273) 106-number-decimal.cobra
I've fixed all of them by adding CultureInfo??.invariantCulture when calling toString or parse. Otherwise, my locale turned "3.2" into "3,2", which wasn't expected by the tests.
I encountered my first problem with test "(130) 504-sharp-error.cobra". This test assumes that the C# will produce error messages in English, which is not the case in my installation.
A similar thing happens with "(445) 500-cannot-infer.cobra", and with "520-debug.cobra". I think we can relax these tests a little bit so that they don't look for specific messages, but rather for things that won't change on a non-English locale. For example, instead of looking for a warning that contains "related to", we can look for a warning that contains simply the line that causes the warning "(3)". If you want I can perform these modifications, and once all tests pass in my installation, create a patch and submit it here.
A different kind of problems occurs with "(639) 410-use-lowernames-dll.cobra". This took me a while to figure out. Apparently, the test is referencing a lowernames.dll file that should be in the current path. Instead, there is a lowernames.cs file. I got the test to pass by manually compiling this .cs file, which generates the necessary dll, but this is not done automatically when I install from source and run -testify. I don't know how to solve this problem, can you help me?
Also, there seems to be a minor issue with the testify script itself. When a test fails, the test count is incremented twice, and the test name is written twice. For example:
...
(taken from ticket:146)