Merge pull request #4928 from kumpera/ptr_to_struct_intrinsic
[mono.git] / mcs / tests / test-anon-119.cs
1
2
3 // Test case for bug: #349034
4
5 using System;
6 using System.Collections.Generic;
7 using System.Text.RegularExpressions;
8
9 class Test {
10         private static void TestNaturalSort()
11         {
12             Comparison<string> naturalSortComparer = (left, right) => {
13                 return Regex.Replace(left ?? "", @"([\d]+)|([^\d]+)", m =>
14 (m.Value.Length > 0 && char.IsDigit(m.Value[0])) ?
15 m.Value.PadLeft(Math.Max((left ?? "").Length, (right ?? "").Length)) :
16 m.Value).CompareTo(Regex.Replace(right ?? "", @"([\d]+)|([^\d]+)", m =>
17 (m.Value.Length > 0 && char.IsDigit(m.Value[0])) ?
18 m.Value.PadLeft(Math.Max((left ?? "").Length, (right ?? "").Length)) :
19 m.Value));
20             };
21         }
22
23         public static void Main ()
24         {
25                 TestNaturalSort ();
26         }
27 }