David MENTRE <[EMAIL PROTECTED]> writes:

> Yes, using LANG=C when calling my program solves the issue. But for my
> autotests, I need to do that *from* the program. Do you see a way to set
> the locale from OCaml, for a given part of the code?

Ok, I've found a work around, calling Printf.sprintf to generate the
result test. It is probably less clear than before but works across any
locale.

For those following demexp development, I've applied following patch:
-    assert(time_as_string 0.000000001 = "1.000 ns"); 
-    assert(time_as_string 0.000001 = "1.000 us"); 
-    assert(time_as_string 0.001 = "1.000 ms"); 
-    assert(time_as_string 1. = "1.000 s"); 
+    assert(time_as_string 0.000000001 = Printf.sprintf "%.3f ns" 1.0);
+    assert(time_as_string 0.000001 = Printf.sprintf "%.3f us" 1.0);
+    assert(time_as_string 0.001 = Printf.sprintf "%.3f ms" 1.0);
+    assert(time_as_string 1. = Printf.sprintf "%.3f s" 1.0);


Best wishes,
d.
-- 
 [EMAIL PROTECTED]



_______________________________________________
Demexp-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/demexp-dev

Répondre à