[Mono-bugs] [Bug 710522] New: TimeSpan.TryParse is not strict enough

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Aug 4 18:03:23 EDT 2011



           Summary: TimeSpan.TryParse is not strict enough
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: joe at mistachkin.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
Gecko/20110707 Firefox/3.6.19 ( .NET CLR 3.5.30729; .NET4.0E)

using System;

namespace ConsoleApplication1
    class Program
        static void Main(string[] args)
            TimeSpan timeSpan;

            Console.WriteLine("{0} {1} {2} {3} {4} {5}",
                TimeSpan.TryParse("001:00.00", out timeSpan), timeSpan,
                TimeSpan.TryParse("01:000.00", out timeSpan), timeSpan,
                TimeSpan.TryParse("01:00.000", out timeSpan), timeSpan);

Reproducible: Always

Steps to Reproduce:
1. Compile and run the above C# code on .NET and Mono.
2. Observe that the results differ on .NET and Mono.

Actual Results:  
True 01:00:00 True 01:00:00 True 01:00:00

Expected Results:  
False 00:00:00 False 00:00:00 False 00:00:00

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list