Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RegexMatchTests.cs « System.Text.RegularExpressions « Test « System « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e9aeb72b61b244762165c6b639270da9afd8da48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
using System;
using System.Text;
using System.Text.RegularExpressions;

using NUnit.Framework;

namespace MonoTests.System.Text.RegularExpressions
{
	[TestFixture]
	public class RegexMatchTests
	{
		static RegexTrial [] trials = new RegexTrial [] {
			new RegexTrial (@"(a)(b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3)"),//0
			new RegexTrial (@"(a)(?<1>b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)"),//1
			new RegexTrial (@"(a)(?<2>b)(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[1]=(1,1)(2,1)"),//2
			new RegexTrial (@"(a)(?<foo>b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)"),//3
			new RegexTrial (@"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910LL", "Pass. Group[0]=(0,13)"//4
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(3,1)"
			+ " Group[5]=(4,1)"
			+ " Group[6]=(5,1)"
			+ " Group[7]=(6,1)"
			+ " Group[8]=(7,1)"
			+ " Group[9]=(8,1)"
			+ " Group[10]=(9,2)"
			+ " Group[11]=(11,1)"
			),
			new RegexTrial (@"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.ExplicitCapture, "F2345678910LL", "Fail."),//5
			new RegexTrial (@"(F)(2)(3)(4)(5)(6)(?<S>7)(8)(9)(10)(L)\1", RegexOptions.None, "F2345678910L71", "Fail."),//6
			new RegexTrial (@"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910LF1", "Fail."),//7
			new RegexTrial (@"(F)(2)(3)(4)(5)(6)(?<S>7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910L71", "Pass."//8
			+ "	Group[0]=(0,13)"
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(3,1)"
			+ " Group[5]=(4,1)"
			+ " Group[6]=(5,1)"
			+ " Group[7]=(7,1)"
			+ " Group[8]=(8,1)"
			+ " Group[9]=(9,2)"
			+ " Group[10]=(11,1)"
			+ " Group[11]=(6,1)"
			),
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\10", RegexOptions.None, "F2345678910L71", "Pass."//9
			+ "	Group[0]=(0,13)"
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(4,1)"
			+ " Group[5]=(5,1)"
			+ " Group[6]=(7,1)"
			+ " Group[7]=(8,1)"
			+ " Group[8]=(9,2)"
			+ " Group[9]=(11,1)"
			+ " Group[10]=(3,1)(6,1)"
			),
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\10", RegexOptions.ExplicitCapture, "F2345678910L70", "Fail."),//10
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\1", RegexOptions.ExplicitCapture, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(3,1)(6,1)"),//11
			new RegexTrial (@"(?n:(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\1)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(3,1)(6,1)"),//12
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(10)\10)", RegexOptions.None, "F2345678910L70","Pass."//13
			+ "	Group[0]=(0,13)"
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(4,1)"
			+ " Group[5]=(5,1)"
			+ " Group[6]=(7,1)"
			+ " Group[7]=(8,1)"
			+ " Group[8]=(9,2)"
			+ " Group[9]=(11,1)"
			+ " Group[10]=(3,1)(6,1)"
			),
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(S)|\10)", RegexOptions.None, "F2345678910L70","Pass."//14
			+ "	Group[0]=(0,12)"
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(4,1)"
			+ " Group[5]=(5,1)"
			+ " Group[6]=(7,1)"
			+ " Group[7]=(8,1)"
			+ " Group[8]=(9,2)"
			+ " Group[9]=(11,1)"
			+ " Group[10]=(3,1)(6,1)"
			),
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(7)|\10)", RegexOptions.None, "F2345678910L70","Pass."//15
			+ "	Group[0]=(0,12)"
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(4,1)"
			+ " Group[5]=(5,1)"
			+ " Group[6]=(7,1)"
			+ " Group[7]=(8,1)"
			+ " Group[8]=(9,2)"
			+ " Group[9]=(11,1)"
			+ " Group[10]=(3,1)(6,1)"
			),
			new RegexTrial (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(K)|\10)", RegexOptions.None, "F2345678910L70","Pass."//16
			+ "	Group[0]=(0,13)"
			+ " Group[1]=(0,1)"
			+ " Group[2]=(1,1)"
			+ " Group[3]=(2,1)"
			+ " Group[4]=(4,1)"
			+ " Group[5]=(5,1)"
			+ " Group[6]=(7,1)"
			+ " Group[7]=(8,1)"
			+ " Group[8]=(9,2)"
			+ " Group[9]=(11,1)"
			+ " Group[10]=(3,1)(6,1)"
			),
			new RegexTrial (@"\P{IsHebrew}", RegexOptions.None, "Fì", "Pass. Group[0]=(0,1)"),//17
			new RegexTrial (@"\p{IsHebrew}", RegexOptions.None, "Fì", "Pass. Group[0]=(1,1)"),//18
			new RegexTrial (@"(?<=a+)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//19
			new RegexTrial (@"(?<=a*)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)"),//20
			new RegexTrial (@"(?<=a{1,5})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//21
			new RegexTrial (@"(?<=a{1})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//22
			new RegexTrial (@"(?<=a{1,})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//23
			new RegexTrial (@"(?<=a+?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//24
			new RegexTrial (@"(?<=a*?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)"),//25
			new RegexTrial (@"(?<=a{1,5}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//26
			new RegexTrial (@"(?<=a{1}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//27
			new RegexTrial (@"(?<=a{1}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),//28
			new RegexTrial (@"(?<!a+)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)"),//29
			new RegexTrial (@"(?<!a*)(?:a)*bc", RegexOptions.None, "aabc", "Fail."),//30
			new RegexTrial (@"abc*(?=c*)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)"),//31
			new RegexTrial (@"abc*(?=c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//32
			new RegexTrial (@"abc*(?=c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//33
			new RegexTrial (@"abc*(?=c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//34
			new RegexTrial (@"abc*(?=c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//35
			new RegexTrial (@"abc*(?=c*?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)"),//36
			new RegexTrial (@"abc*(?=c+?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//37
			new RegexTrial (@"abc*(?=c{1}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//38
			new RegexTrial (@"abc*(?=c{1,5}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//39
			new RegexTrial (@"abc*(?=c{1,}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),//40
			new RegexTrial (@"abc*?(?=c*)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)"),//41
			new RegexTrial (@"abc*?(?=c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)"),//42
			new RegexTrial (@"abc*?(?=c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)"),//43
			new RegexTrial (@"abc*?(?=c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)"),//44
			new RegexTrial (@"abc*?(?=c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)"),//45
			new RegexTrial (@"abc*(?!c*)", RegexOptions.None, "abcc", "Fail."),//46
			new RegexTrial (@"abc*(?!c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)"),//47
			new RegexTrial (@"abc*(?!c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)"),//48
			new RegexTrial (@"abc*(?!c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)"),//49
			new RegexTrial (@"abc*(?!c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)"),//50
			new RegexTrial (@"(a)(?<1>b)(?'1'c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)(2,1)"),//51
			new RegexTrial (@"(?>a*).", RegexOptions.ExplicitCapture, "aaaa", "Fail."),//52

			new RegexTrial (@"(?<ab>ab)c\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,5) Group[1]=(0,2)"),//53
			new RegexTrial (@"\1", RegexOptions.ECMAScript, "-", "Fail."),//54
			new RegexTrial (@"\2", RegexOptions.ECMAScript, "-", "Fail."),//55
			new RegexTrial (@"(a)|\2", RegexOptions.ECMAScript, "-", "Fail."),//56
			new RegexTrial (@"\4400", RegexOptions.None, "asdf 012", "Pass. Group[0]=(4,2)"),//57
			new RegexTrial (@"\4400", RegexOptions.ECMAScript, "asdf 012", "Fail."),//58
			new RegexTrial (@"\4400", RegexOptions.None, "asdf$0012", "Fail."),//59
			new RegexTrial (@"\4400", RegexOptions.ECMAScript, "asdf$0012", "Pass. Group[0]=(4,3)"),//60
		};

		[Test]
		public void RegexJvmTrial0000 ()
		{
			trials [0].Execute ();
		}

		[Test]
		public void RegexJvmTrial0001 ()
		{
			trials [1].Execute ();
		}

		[Test]
		[Category ("NotDotNet")]
		[Category ("NotWorking")]
		public void RegexJvmTrial0002 ()
		{
			trials [2].Execute ();
		}

		[Test]
		public void RegexJvmTrial0003 ()
		{
			trials [3].Execute ();
		}

		[Test]
		public void RegexJvmTrial0004 ()
		{
			trials [4].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		public void RegexJvmTrial0005 ()
		{
			trials [5].Execute ();
		}

		[Test]
		public void RegexJvmTrial0006 ()
		{
			trials [6].Execute ();
		}

		[Test]
		public void RegexJvmTrial0007 ()
		{
			trials [7].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0008 ()
		{
			trials [8].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0009 ()
		{
			trials [9].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		public void RegexJvmTrial0010 ()
		{
			trials [10].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		public void RegexJvmTrial0011 ()
		{
			trials [11].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		public void RegexJvmTrial0012 ()
		{
			trials [12].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0013 ()
		{
			trials [13].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0014 ()
		{
			trials [14].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0015 ()
		{
			trials [15].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0016 ()
		{
			trials [16].Execute ();
		}

		[Test]
		public void RegexJvmTrial0017 ()
		{
			trials [17].Execute ();
		}

		[Test]
		[Category ("NotWorking")]
		[Category ("NotDotNet")]
		public void RegexJvmTrial0018 ()
		{
			trials [18].Execute ();
		}
		
		[Test]	public void RegexJvmTrial0019 () { trials [19].Execute (); }
		[Test]	public void RegexJvmTrial0020 () { trials [20].Execute (); }
		[Test]	public void RegexJvmTrial0021 () { trials [21].Execute (); }
		[Test]	public void RegexJvmTrial0022 () { trials [22].Execute (); }
		[Test]	public void RegexJvmTrial0023 () { trials [23].Execute (); }
		[Test]	public void RegexJvmTrial0024 () { trials [24].Execute (); }
		[Test]	public void RegexJvmTrial0025 () { trials [25].Execute (); }
		[Test]	public void RegexJvmTrial0026 () { trials [26].Execute (); }
		[Test]	public void RegexJvmTrial0027 () { trials [27].Execute (); }
		[Test]	public void RegexJvmTrial0028 () { trials [28].Execute (); }
		[Test]	public void RegexJvmTrial0029 () { trials [29].Execute (); }
		[Test]	public void RegexJvmTrial0030 () { trials [30].Execute (); }
		[Test]	public void RegexJvmTrial0031 () { trials [31].Execute (); }
		[Test]	public void RegexJvmTrial0032 () { trials [32].Execute (); }
		[Test]	public void RegexJvmTrial0033 () { trials [33].Execute (); }
		[Test]	public void RegexJvmTrial0034 () { trials [34].Execute (); }
		[Test]	public void RegexJvmTrial0035 () { trials [35].Execute (); }
		[Test]	public void RegexJvmTrial0036 () { trials [36].Execute (); }
		[Test]	public void RegexJvmTrial0037 () { trials [37].Execute (); }
		[Test]	public void RegexJvmTrial0038 () { trials [38].Execute (); }
		[Test]	public void RegexJvmTrial0039 () { trials [39].Execute (); }
		[Test]	public void RegexJvmTrial0040 () { trials [40].Execute (); }
		[Test]	public void RegexJvmTrial0041 () { trials [41].Execute (); }
		[Test]	public void RegexJvmTrial0042 () { trials [42].Execute (); }
		[Test]	public void RegexJvmTrial0043 () { trials [43].Execute (); }
		[Test]	public void RegexJvmTrial0044 () { trials [44].Execute (); }
		[Test]	public void RegexJvmTrial0045 () { trials [45].Execute (); }
		[Test]	public void RegexJvmTrial0046 () { trials [46].Execute (); }
		[Test]	public void RegexJvmTrial0047 () { trials [47].Execute (); }
		[Test]	public void RegexJvmTrial0048 () { trials [48].Execute (); }
		[Test]	public void RegexJvmTrial0049 () { trials [49].Execute (); }
		[Test]	public void RegexJvmTrial0050 () { trials [50].Execute (); }
		[Test]	public void RegexJvmTrial0051 () { trials [51].Execute (); }
		[Test]	public void RegexJvmTrial0052 () { trials [52].Execute (); }

		[Test]	public void RegexTrial0053 () { trials [53].Execute (); }
		[Test]	public void RegexTrial0054 () { trials [54].Execute (); }
		[Test]	public void RegexTrial0055 () { trials [55].Execute (); }
		[Test]	public void RegexTrial0056 () { trials [56].Execute (); }
		[Test]	public void RegexTrial0057 () { trials [57].Execute (); }
		[Test]	public void RegexTrial0058 () { trials [58].Execute (); }
		[Test]	public void RegexTrial0059 () { trials [59].Execute (); }
		[Test]	public void RegexTrial0060 () { trials [60].Execute (); }
	}
}