Commit Graph
66 Commits
Author SHA1 Message Date
Rodrigo Kumpera 8f2c8508de 2010-06-21 Rodrigo Kumpera <[email protected]>
* RegexBugs.cs: Regression test for #610587.

svn path=/trunk/mcs/; revision=159293
2010-06-21 20:36:17 +00:00
Rodrigo Kumpera 3905873f3c 2010-02-03 Rodrigo Kumpera <[email protected]>
* SplitTests.cs: New tests for #566117.

svn path=/trunk/mcs/; revision=150787
2010-02-03 21:10:25 +00:00
Raja R Harinath 66fee73c0a Final piece of explicit numeric group support
* parser.cs (gap): New.
(GetMapping): Return it.
(ResolveReferences): Collect explicit numeric groups which may not
match their indices.
(HandleExplicitNumericGroups): New.  Process the above list to
assign appropriate indices, and compute the correct value of 'gap'.

svn path=/trunk/mcs/; revision=140290
2009-08-19 20:43:01 +00:00
Raja R Harinath 51c4ad074a * parser.cs (ResolveReferences): Handle some cases of explicitly-named numeric groups.
svn path=/trunk/mcs/; revision=140096
2009-08-17 19:26:18 +00:00
Raja R Harinath 58b4f2fb60 * RegexTrial.cs (Execute): Prepare to handle dis-contiguous group numbers.
svn path=/trunk/mcs/; revision=140052
2009-08-17 12:28:23 +00:00
Raja R Harinath 1163a482f7 regexp backreferences: Implement fallback to octal numbers, and ECMAScript semantics.
* syntax.cs (BackslashNumber.ResolveReference): Implement fallback
to octal numbers, and ECMAScript semantics.
* parser.cs (ResolveReferences): Use it.
* RegexMatchTests.cs (RegexTrial0054..60): New.

svn path=/trunk/mcs/; revision=139657
2009-08-10 16:25:10 +00:00
Raja R Harinath 88c39f81b9 Regex.IsMatch("abcab", @"(?<ab>ab)c\1")
* System.Text.RegularExpressions/parser.cs (ResolveReferences):
Allow named groups to be referred-to by their group numbers too.
* RegexMatchTests.cs (RegexTrial0053): New.

svn path=/trunk/mcs/; revision=139655
2009-08-10 16:24:21 +00:00
Jonathan Pryor 247cfd34f0 * System.Text.RegularExpressions/Regex.cs (Replace): Check that input &
evaluator are not null, as documented in MSDN (and the variance found 
	  while testing DbLinq).
	* Test/System.Text.RegularExpressions/RegexReplace.cs: Add null 
	  argument checks for Regex.Replace().

svn path=/trunk/mcs/; revision=128241
2009-02-27 21:40:17 +00:00
Zoltan Varga 38444bef3b 2009-01-14 Zoltan Varga <[email protected]>
* RegexTrial.cs: Run all tests with the CIL Compiler too.

svn path=/trunk/mcs/; revision=123419
2009-01-14 21:36:01 +00:00
Zoltan Varga ebd4ba561f 2009-01-14 Zoltan Varga <[email protected]>
* RegexBugs.cs: Add a test for #466151.

svn path=/trunk/mcs/; revision=123418
2009-01-14 21:34:46 +00:00
Gert Driesen 5bf5128a72 * RegexBugs.cs: added test for bug #443841.
svn path=/trunk/mcs/; revision=118761
2008-11-13 20:20:00 +00:00
Gonzalo Paniagua Javier a9497316ff 2008-11-11 Gonzalo Paniagua Javier <[email protected]>
* RegexBugs.cs: test from bug 432172.


svn path=/trunk/mcs/; revision=118512
2008-11-11 16:42:18 +00:00
Gonzalo Paniagua Javier ab2d87302f 2008-10-30 Gonzalo Paniagua Javier <[email protected]>
* RegexBugs.cs: added test from bug #439947.


svn path=/trunk/mcs/; revision=117488
2008-10-30 16:04:57 +00:00
Zoltan Varga a1531dd064 2008-10-09 Zoltan Varga <[email protected]>
* RegexBugs.cs: Add test for #432172.

svn path=/trunk/mcs/; revision=115312
2008-10-09 08:00:46 +00:00
Zoltan Varga 6dad6b5f3b 2008-09-14 Zoltan Varga <[email protected]>
* RegexBugs.cs: Add a test for #426142.

svn path=/trunk/mcs/; revision=112946
2008-09-14 00:07:44 +00:00
Roei Erez ccca1e1079 Fix a bug only in TARGET_JVM that happens when a match contains empty group at the end.
svn path=/trunk/mcs/; revision=104994
2008-06-05 12:06:06 +00:00
Raja R Harinath 01dbfb50d5 Fix 324390
In System/System.Text.RegularExpressions:
	* BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
	to deduce absence of matches -- a match can have length 0.
	(RTLReplace): Likewise.

In System/Test/System.Text.RegularExpressions:
	* RegexReplace.cs (tests): New test from #324390.

svn path=/trunk/mcs/; revision=89176
2007-11-08 03:31:44 +00:00
Raja R Harinath b35097bc0b Support RegexOptions.RightToLeft in Replace().
In b/class/System/System.Text.RegularExpressions:
	* BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
	based on regex.
	(LTRReplace): Make internal and rename the MatchAppendEvaluator
	version of Replace to this.
	(RTLReplace): New.
	* Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
	* replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
	Based on patch by Stephane Delcroix.

In b/class/System/Test/System.Text.RegularExpressions:
	* MatchTest.cs (Match_Backref): New.
	* RegexReplace.cs (direction, testcase.direction): New.
	(testcase..ctor): Allow specifying the direction of the replace.
	(ReplaceTests): Test replace in both directions.
	(EvaluatorTests): New test based on #321036.

svn path=/trunk/mcs/; revision=89034
2007-11-06 22:03:35 +00:00
Raja R Harinath baf4cdef81 In System.Text.RegularExpressions:
* replace.cs (Compile): Don't unescape string.

In Test/System.Text.RegularExpressions:
	* RegexReplace.cs (tests): New test from #317092.
	(ReplaceTests): Don't catch an AssertException.

svn path=/trunk/mcs/; revision=89021
2007-11-06 19:28:12 +00:00
Gert Driesen 99c7c20a33 * RegexReplace.cs: Fixed line endings.
svn path=/trunk/mcs/; revision=88686
2007-11-01 21:19:14 +00:00
Gert Driesen 083af1ff31 * GroupTest.cs: Improved test for null argument check.
* MatchTest.cs: Improved tests for null argument checks. Added and
fixed replacement tests.
* RegexMatchTest.cs: Marked tests that do not pass on MS as NotDotNet.
Fixed expected result for trial 5.
* RegexResultTests.cs: Fixed Assert.
* Match.cs: Do not throw NotSupportedException on zero-length 
replacement argument.

svn path=/trunk/mcs/; revision=88685
2007-11-01 21:17:50 +00:00
Arina Itkes 963b4f5073 Updated changelog fog revision 88355
svn path=/trunk/mcs/; revision=88392
2007-10-29 16:12:39 +00:00
Gert Driesen 159ff004eb * RegexBugs.cs: No longer derive from deprecated Assertion class.
Added test for bug #313642.
* MatchTest.cs: Code formatting.
* RegexTest.cs: Fixed compiler warnings. Code formatting. Spaces to
tabs.

svn path=/trunk/mcs/; revision=87864
2007-10-21 09:46:50 +00:00
Gert Driesen bea2c42267 * RegexReplace.cs: Fixed compiler warning.
svn path=/trunk/mcs/; revision=85913
2007-09-17 17:30:51 +00:00
Raja R Harinath 05c754d952 In System.Text.RegularExpressions:
Fix #80554
	* parser.cs (ResolveReferences): Don't throw an expression if a
	capture assertion reference cannot be resolved.
	(ParseGroupingConstruct): Provide fallback expression to a capture
	assertion.
	* syntax.cs (CaptureAssertion): If the bareword doesn't refer to
	the name of a capture group, fallback to treating it as a literal
	expression.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (bug80554_trials): New tests based on #80554.

svn path=/trunk/mcs/; revision=75885
2007-04-18 14:52:01 +00:00
Raja R Harinath e1bb85b9d7 * RegexTest.cs (PrimeRegex): New backtracking torture test using
a regex that recognizes composite numbers represented in unary.

svn path=/trunk/mcs/; revision=75388
2007-04-04 14:33:46 +00:00
Raja R Harinath 24bba3fcc8 In System.Text.RegularExpressions:
Fix #79472
	* parser.cs (Parser.GetMapping): Use the actual group numbers to
	build the mapping.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (GroupNumbers): New test based on #79472.

svn path=/trunk/mcs/; revision=70374
2007-01-02 17:52:33 +00:00
Raja R Harinath 083ccb79d8 In System.Text.RegularExpressions:
Fix #78278
	Remove 65535-limit on number of repetitions matched by a pattern.
	We still have a 65535 limit on the length of a pattern and the
	number of groups in a pattern.
	* compiler.cs (PatternCompiler.EmitCount): New.  Emits an int as
	two ushorts into the program stream.
	(EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
	rather than shorts.
	* interpreter.cs (Intepreter.ReadProgramCount): Read an int
	emitted into the program stream.
	(Interpreter): Use it.  Update counts.
	(Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
	* parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
	and '+' repetition patterns.
	* arch.cs (Info, Repeat, FastRepeat): Update description.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (Kill65535_1, Kill65535_2, No65535Limit): New tests
	based on #78278.

svn path=/trunk/mcs/; revision=60401
2006-05-08 13:44:23 +00:00
Raja R Harinath a0072aeec0 In System.Text.RegularExpressions:
2006-04-17  Florian Gross  <[email protected]>
	    Raja R Harinath  <[email protected]>

	* syntax.cs (CharacterClass.Compile): Emit categories after the
	character intervals so that the evaluator can pick up the
	'IgnoreCase' flag.

In Test/System.Text.RegularExpressions:
2006-04-17  Florian Gross  <[email protected]>

	* RegexBugs.cs (CharClassWithIgnoreCase): Ensure that character
	classes don't interfere with RegexOptions.IgnoreCase.

Started looking at some of Florian's patches, which I realized now that
he hadn't applied.

svn path=/trunk/mcs/; revision=59538
2006-04-17 14:05:46 +00:00
Raja R Harinath d96a4c42b2 In System.Text.RegularExpressions:
Fix #78007
	* interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
	Don't reset 'ptr' to 0 during forward scan.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (Bug78007): New test from #78007.

svn path=/trunk/mcs/; revision=59177
2006-04-07 13:44:55 +00:00
Raja R Harinath 4d94dda2bf In System.Text.RegularExpressions:
Fix #76345
	* interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
	tail operation has a 'negate' flag, avoid the "match next char"
	optimization.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (Bug76345): New test from #76345.

svn path=/trunk/mcs/; revision=59174
2006-04-07 12:01:44 +00:00
Raja R Harinath aeacac9505 In System.Text.RegularExpressions:
Fix #69269
	* arch.cs (OpCode.NotCategory): New.  Stands for matching a
	character _not_ from the given category.
	* debug.cs (DisassembleBlock): Handle it.
	* compiler.cs (ICompiler.EmitNotCategory): New.
	(Compiler.EmitNotCategory): New.  Emit OpCode.NotCategory.
	* syntax.cs (CharacterClass.Compile): Don't conflate negation of
	the character class and negation of the category.  Use
	EmitNotCategory.
	* interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
	EvalChar.
	(Interpreter.EvalChar): Handle it.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (Bug69269): New test from #69269.

svn path=/trunk/mcs/; revision=59173
2006-04-07 10:00:23 +00:00
Raja R Harinath 91300ea498 Fix #77487
* System.Text.RegularExpressions/interpreter.cs (Eval) [Until, FastUntil]:
Set 'deep' to null when evaluating the tail.  Ensure that backtracks don't
confuse the recursion vs. iteration detector.
* Test/System.Text.RegularExpressions/RegexBugs.cs (Bug77487):
New test based on #77487.

svn path=/trunk/mcs/; revision=59114
2006-04-06 14:29:06 +00:00
Raja R Harinath 345512578e * RegexTrial.cs (Execute): Run NUnit assertion here.
* PerlTests.cs: Simplify.

svn path=/trunk/mcs/; revision=59112
2006-04-06 13:03:29 +00:00
Raja R Harinath 5718114083 In System.Text.RegularExpressions:
* parser.cs (Parser.ParseCharacterClass): Handle some more errors.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (HangingHyphens1): New testcase for exceptions in character ranges.

svn path=/trunk/mcs/; revision=58806
2006-03-30 16:37:29 +00:00
Raja R Harinath 0117c762c6 In System.Text.RegularExpressions:
* parser.cs (Parser.ParseCharacterClass): Don't automatically
	assume there's a range when we see '-'.  Ensure that we have seen
	at least one other character, and that we aren't already parsing a
	range.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (HangingHyphens): New tests from #77626, and
	related bugs found by inspection.

svn path=/trunk/mcs/; revision=58776
2006-03-30 12:29:51 +00:00
Raja R Harinath 41c152eba7 In System.Text.RegularExpressions:
Fix #77626
	* parser.cs (Parser.ParseCharacterClass): Set 'last' when we find
	that a '-' doesn't signify a range.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (HangingHyphens): New test from #77626.

svn path=/trunk/mcs/; revision=58774
2006-03-30 10:18:44 +00:00
Sebastien Pouliot 34cc16225f 2005-11-21 Sebastien Pouliot <[email protected]>
* CaptureCas.cs: New. CAS tests.
	* CaptureCollectionCas.cs: New. CAS tests.
	* GroupCas.cs: New. CAS tests.
	* GroupCollectionCas.cs: New. CAS tests.
	* GroupTest.cs: New. Unit tests.
	* MatchCas.cs: New. CAS tests.
	* MatchCollectionCas.cs: New. CAS tests.
	* MatchTest.cs: New. Unit tests.
	* RegexCas.cs: New. CAS tests.
	* RegexCompilationInfoCas.cs: New. CAS tests.
	* RegexCompilationInfoTest.cs: New. Unit tests.
	* RegexRunnerCas.cs: New. CAS tests.
	* RegexRunnerFactoryCas.cs: New. CAS tests.
	* RegexTest.cs: Added test cases for new (2.0) CacheSize property.


svn path=/trunk/mcs/; revision=53313
2005-11-21 18:37:01 +00:00
Raja R Harinath 9106f292c5 In System.Text.RegularExpressions:
* MatchCollection.cs: Convert to incremental mode.
	* regex.cs (Regex.Matches): Update.  Pass responsibility of
	generating all matches to MatchCollection.

In Test/System.Text.RegularExpressions:
	* RegexTest.cs (Matches1, Matches2, ..., Matches10): Combine into ...
	(Matches): ... this.  Convert to use a data-driven approach.  Use ...
	(trials): ... this.  New variable that lists the regexp, input
	text and expected results.
	(runTrial): New.  Run a suite of MatchCollection tests on each trial.
	Tests both incremental and non-incremental modes.

svn path=/trunk/mcs/; revision=47079
2005-07-08 09:49:44 +00:00
Raja R Harinath 4e8fc6ec9a In System.Text.RegularExpressions:
Fix #74753.
	* Match.cs (Match) [zero-argument variant]: Make private.
	* GroupCollection (Item) [string variant]: Don't look for the
	group number in an empty match.

In Test/System.Text.RegularExpressions:
	* RegexBugs.cs (NameLookupInEmptyMatch): New test from #74753.

svn path=/trunk/mcs/; revision=45958
2005-06-14 11:44:35 +00:00
Raja R Harinath 3f3a350f4d * RegexReplace.cs: Add a couple more testcases.
svn path=/trunk/mcs/; revision=44993
2005-05-25 12:16:58 +00:00
Raja R Harinath afc63db0fa In Test/System.Text.RegularExpressions:
* RegexReplace.cs: Add testcase for $+.

In System.Text.RegularExpressions:
	* replace.cs (ReplacementEvaluator.CompileTerm): Fix group
	returned by $+.

svn path=/trunk/mcs/; revision=44925
2005-05-24 10:28:19 +00:00
Raja R Harinath 2b8fc93056 In .:
* System_test.dll.sources: Add
	System.Text.RegularExpressions/RegexReplace.cs.

In System.Text.RegularExpressions:
	Fix #74735.
	* replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
	fail and yet have advanced the pointer.  Append the scanned-over
	portion to the "literal" being built.
	(ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
	If a term cannot be recognized, just return null.

In Test/System.Text.RegularExpressions:
	* RegexReplace.cs: New file.  Most of the tests were inspired by
	#74735.

svn path=/trunk/mcs/; revision=44813
2005-05-20 12:44:24 +00:00
Gonzalo Paniagua Javier e7a86813a4 2005-04-20 Gonzalo Paniagua Javier <[email protected]>
* PerlTest.cs: split.


svn path=/trunk/mcs/; revision=43313
2005-04-20 07:05:26 +00:00
Gonzalo Paniagua Javier 077a8f3009 2005-02-27 Gonzalo Paniagua Javier <[email protected]>
* RegexBugs.cs: Modified file.


svn path=/trunk/mcs/; revision=41252
2005-02-27 09:48:00 +00:00
Gonzalo Paniagua Javier d5525426a5 2005-01-10 Gonzalo Paniagua Javier <[email protected]>
* RegexBugs.cs: tests for bug #69065.


svn path=/trunk/mcs/; revision=38654
2005-01-10 22:44:15 +00:00
Miguel de Icaza 19e3d1f3fc 2005-01-08 Miguel de Icaza <[email protected]>
* syntax.cs: Applied patch from [email protected] to fix bug
	#71077.

	* parser.cs: Turns out that \digit sequences are octal sequences
	(no leading zero is needed);  And the three octal digit rule
	applies to the leading zero as well.

	This fixes the Unescape method.

2005-01-08  Miguel de Icaza  <[email protected]>

	* RegexBugs.cs: Add new test.



svn path=/trunk/mcs/; revision=38517
2005-01-08 06:21:04 +00:00
Nick Drochak 755b9d2bdf 2005-01-08 Nick Drochak <[email protected]>
* TypeDescriptorTests.cs:
	* System.ComponentModel/ChangeLog
	* System.ComponentModel/TypeDescriptorTests.cs
	* System.Net.Sockets/ChangeLog
	* System.Net.Sockets/SocketTest.cs
	* System.Text.RegularExpressions/ChangeLog
	* System.Text.RegularExpressions/RegexTest.cs
	* System/ChangeLog
	* System/UriTest.cs
	* System/UriTest2.cs: Fix/Ignore tests for MS.NET

svn path=/trunk/mcs/; revision=38493
2005-01-07 15:42:31 +00:00
Gonzalo Paniagua Javier ecb1231274 sigh
svn path=/trunk/mcs/; revision=36800
2004-11-30 01:24:51 +00:00
Gonzalo Paniagua Javier 270aaf7f1e 2004-11-29 Gonzalo Paniagua Javier <[email protected]>
* Test/System.Text.RegularExpressions/RegexBugs.cs: test case for bug
	#57274.

	* System.Text.RegularExpressions/regex.cs: use NextMatch to move on to
	the next match. Fixes bug #57274.


svn path=/trunk/mcs/; revision=36798
2004-11-30 01:01:22 +00:00