Commit Graph
126 Commits
Author SHA1 Message Date
Zoltan Varga 03aee949f1 Merge pull request #1200 from akoeplinger/remove-jvm
[Cleanup] Remove TARGET_JVM
2014-08-28 19:17:43 -04:00
Marek Safar f070b646f6 [corlib] Handle String::Format with escaped closing }. Fixes #22114 2014-08-21 10:35:38 +02:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
David Schmitt 3f9dd10eed [System] handle arguments whose ToString returns null in String.Format
When an argument to String.Format has no formatter, its ToString method
is called. This change takes care that the FormatHelper can handle
arguments whose ToString() method returns null.
2014-04-16 09:26:23 +02:00
Marek Safar 27836846a5 [corlib] Add overflow checks to string padding 2014-02-04 12:44:44 +01:00
Rodrigo Kumpera 9f9ba76d77 [corlib]String.IndexOf is culture aware, while String.Contains is not. 2013-06-21 20:31:12 -04:00
Martin Potter edc38904d9 Making the behavior of substring versions of string.CompareOrdinal and string.CompareOrdinalCaseInsensitive match Microsoft's implementation.
The MSDN documentation states "Because CompareOrdinal is a static method, strA and strB can be null. If both values are null, the method returns 0 (zero), which indicates that strA and strB are equal. If only one of the values is null, the method considers the non-null value to be greater." Previously, CompareOrdinal and CompareOrdinalCaseInsensitive would throw a NullReferenceException if strA or strB was null.
2012-11-27 08:20:51 -08:00
Marek Safar d2e4710c16 CompareOrdinal quick path cannot ignore start index. Fixes #6553 2012-09-04 17:48:39 +02:00
Marek Safar f74872ab7f Don't throw NRE when custom formatter returns null 2012-08-09 10:51:03 +01:00
Rodrigo Kumpera 5d440c757b Fix the String.Intern test to reflect the fact that String.Intern can return a different result. 2012-06-18 16:44:11 -03:00
Marek Safar 3c9dbb0d28 Fix range check in string::Split 2012-04-27 17:25:57 +01:00
Andres G. Aragoneses 4fc9ee5caf corlib: return a non-empty array if RemoveEmptyEntries is not passed
Keep the previously correct behaviour about returning new String[1]{Empty} if StringSplitOptions.RemoveEmptyEntries is not passed, and add a test for it (it wasn't being tested before).
2012-03-05 18:32:09 +00:00
Andres G. Aragoneses 61f33b0e41 corlib: String.Split() now returns empty array too for Empty when splitting chars
String.Empty.Split(char[]) didn't have the same behaviour as String.Empty.Split(string[]).
2012-03-05 18:08:26 +00:00
Marek Safar d0ef6a346d Remove static whitespace characters from string, speed up Split for whitespace characters up to 10x 2012-02-24 11:41:14 +00:00
Marek Safar 7e8166b4da Make strings PadLeft|PadRight homogeneous 2012-02-21 11:30:31 +00:00
Marek Safar b42a20c0e4 string.Split method should look for delimiters by performing comparisons using case-sensitive ordinal sort rules. Fixes #3534 2012-02-20 14:48:29 +00:00
Marek Safar 61f9e5938d Make string::Trim .net 4 compatible. Fixes #3408 2012-02-14 16:05:46 +00:00
Marek Safar e270257d60 Make string::Split .net 4 compatible 2012-02-14 16:05:46 +00:00
Marek Safar bf8fe085a2 Fix wrong string unit test 2011-09-06 11:58:59 +01:00
Marek Safar ac96f05be2 Remove NET_2_0 2011-09-06 11:58:58 +01:00
Zoltan Varga aa8cd8e0f7 Disable some invalid string ctor tests 2011-08-31 02:33:39 +02:00
Atsushi Eno a0a00924d2 Marked a couple of tests as NotDotNet as they blocked nunit completion on .NET. 2011-04-06 16:53:02 +09:00
Rodrigo Kumpera 586295c91d Fix handling of LastIndexOf and empty strings.
* String.cs (LastIndexOf): All all overloads to
	be compatible with MS with empty strings.

        * String.cs (LastIndexOfAny): Ditto.

	* StringTest.cs: Add tests for the above.

	Fixes #605340
2010-11-09 13:11:28 -02:00
Jonathan Pryor 71d1db748c * System/String.cs: Fix String.Split(String[],int,StringSplitOptions)
so that:
	  - it properly obeys the 'count' parameter; Fixes #601772.
	  - "...".Split(new[]{"."}, 2, StringSplitOptions.RemoveEmptyEntries).Length==0
	  - "A..".Split (new String[] { "." }, 2, StringSplitOptions.RemoveEmptyEntries) == new[]{"A"}
	  - Remove duplicative array handling code by using List<String>.
	* Test/System/StringTest.cs: Add tests for #601772 (i.e. take 
	  SplitStringChars(), change all the chars to Strings, and things 
	  should work).

svn path=/trunk/mcs/; revision=158670
2010-06-08 15:26:10 +00:00
Atsushi Eno 0ff9ac2db6 2010-05-17 Atsushi Enomoto <[email protected]>
* SimpleCollator.cs : fix extender search index for LastIndexOf().
	  Fixed bug #605094.

	* StringTest.cs : add test for bug #605094.


svn path=/trunk/mcs/; revision=157414
2010-05-17 08:25:04 +00:00
Miguel de Icaza e1c81ab188 Fourth patch from: Damien Diederen <[email protected]>
For bug: https://bugzilla.novell.com/show_bug.cgi?id=480152

    	* Normalization.cs: The correct "checkType" argument to
	Decompose() is NKD or NKFD when normalizing to NKC resp. NKFC.

	* StringTest.cs: More NFC test cases.

svn path=/trunk/mcs/; revision=155965
2010-04-22 21:25:59 +00:00
Miguel de Icaza d4471ebcb1 Third patch from: Damien Diederen <[email protected]>
For bug: https://bugzilla.novell.com/show_bug.cgi?id=480152

	* Normalization.cs: Implement algorithmic Hangul composition.
	Calling Normalize(NormalizationForm.FormC) on Korean characters
	now works properly (bnc#480152).

	* StringTest.cs: Add test cases for Hangul composition.


svn path=/trunk/mcs/; revision=155964
2010-04-22 21:25:34 +00:00
Miguel de Icaza fe997730cc Second patch from: Damien Diederen <[email protected]>
For bug: https://bugzilla.novell.com/show_bug.cgi?id=480152

	* Normalization.cs: Follow the spec when checking composition pairs.

	Figure 7 in section 1.3 of http://unicode.org/reports/tr15/ shows
	how when doing composition, one has to examine the successive
	(starter, candidate) pairs, and combine if a matching canonical
	decomposition exists.

	The original algorithm was, instead, iterating on canonical
	decompositions, and, for each one, trying to match a sequence
	of (starter, non-starter, ...).	 This, however, does not produce
	the same results as it is violating some implicit ordering
	constraints in the Unicode tables.

	E.g., when composing the following sequence of codepoints, the
	original algorithm was picking:

	  03B7 0313 0300 0345
	  ^^^^	    ^^^^
	  1F74 0313	 0345
	  ^^^^	         ^^^^
	  1FC2 0313

	and would stop at 1FC2 0313 as there is no decomposition matching
	it.  The new algorithm, which follows the guidance of the pretty
	figure 7, ends up doing:

	  03B7 0313 0300 0345
	  ^^^^ ^^^^
	  1F20	    0300 0345
	  ^^^^	    ^^^^
	  1F22	         0345
	  ^^^^	         ^^^^
	  1F92

	resulting in the correct 1F92.

svn path=/trunk/mcs/; revision=155963
2010-04-22 21:25:04 +00:00
Miguel de Icaza 08d5d47c72 First patch from: Damien Diederen <[email protected]>
For bug: https://bugzilla.novell.com/show_bug.cgi?id=480152

	* Normalization.cs: Recursively apply the Unicode decomposition mapping.

	According to http://www.unicode.org/reports/tr15/tr15-31.html,
	section 1.3:

	"To transform a Unicode string into a given Unicode Normalization
	Form, the first step is to fully decompose the string. [...] Full
	decomposition involves recursive application of the
	Decomposition_Mapping values, because in some cases a complex
	composite character may have a Decomposition_Mapping into a
	sequence of characters, one of which may also have its own
	non-trivial Decomposition_Mapping value."

svn path=/trunk/mcs/; revision=155962
2010-04-22 21:24:18 +00:00
Zoltan Varga 0d4aa9fc89 2010-04-19 Zoltan Varga <[email protected]>
* CompareInfo.cs (IndexOf): Return startIndex instead of 0 for empty strings.
	Fixes #597604.

svn path=/trunk/mcs/; revision=155698
2010-04-19 08:28:50 +00:00
Zoltan Varga dc9dc97d57 In System:
2009-12-19  Zoltan Varga  <[email protected]>

	* String.cs: Fix the various IndexOf and LastIndexOf methods so they handle
	"" and a non-zero startIndex correctly. Fixes #566106.

In Test/System:

2009-12-19  Zoltan Varga  <[email protected]>

	* StringTest.cs: Add tests for IndexOf ("", startIndex, count).

svn path=/trunk/mcs/; revision=148789
2009-12-19 21:21:27 +00:00
Sebastien Pouliot 078e125ca6 In System:
2009-12-17  Sebastien Pouliot  <[email protected]>

	* String.cs: Fix #565602 right-padding empty strings.

In Test/System:
2009-12-17  Sebastien Pouliot  <[email protected]>

	* StringTest.cs: Add test case for right padding an empty string


svn path=/trunk/mcs/; revision=148706
2009-12-17 15:30:28 +00:00
Sebastien Pouliot 07efc64d03 In System:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* String.cs: Remove unused (and unneeded) internal call defs.
	Reduce duplication (and fix test) for Concat (object,object).
	Avoid allocating zero-length strings in the cases where the
	FX does not do so.

In Test/System.Text:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* UnicodeEncodingTest.cs: Add test cases with an odd number of 
	bytes being used in GetString (it does not crash but it does not
	work like MS FX either).

In Test/System:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* StringTest.cs: Add test case for methods that can return
	empty strings.

In System.Globalization:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* TextInfo.cs: Avoid allocating zero-length strings in ToLower 
	and ToUpper methods


svn path=/trunk/mcs/; revision=144921
2009-10-27 23:42:55 +00:00
Jonathan Chambers 844c6d9c8a 2009-10-06 Jonathan Chambers <[email protected]>
* String.cs (Contains): Use CompareOptions.Ordinal. Fixes bug
        #535425.


svn path=/trunk/mcs/; revision=143519
2009-10-06 15:14:12 +00:00
Atsushi Eno 9c6cb77223 2009-09-18 Atsushi Enomoto <[email protected]>
* Normalization.cs : Handle blocked characters which are not
	  immediately next to the primary composite character. This fixes
	  some Arabic string sequence normalization.
	* Makefile : fix test build.

	* StringTest.cs : add more normalization tests.


svn path=/trunk/mcs/; revision=142249
2009-09-19 04:37:12 +00:00
Robert Jordan 625757a962 2009-06-26 Robert Jordan <[email protected]>
* StringTest.cs: Convert all tests to new-style nunit 
	classes/methods.


svn path=/trunk/mcs/; revision=137011
2009-06-26 21:29:00 +00:00
Atsushi Eno 97d43a12a8 2008-06-19 Atsushi Enomoto <[email protected]>
* Normalization.cs :
	  - reverted the previous index calculation change. It was correctly
	    implemented and I rather broke it.
	  - fix index calculation on combining.
	  - NFKD was incorrectly directed to combining path. It should not.
	  - Simplify quick check.

	* StringTest.cs : Fix the previous test. It was expecting wrong
	  results. Added another NFC composition test.


svn path=/trunk/mcs/; revision=136474
2009-06-19 10:17:26 +00:00
Zoltan Varga 8a589623e4 2009-06-16 Zoltan Varga <[email protected]>
* StringTest.cs: Fix make check.

svn path=/trunk/mcs/; revision=136177
2009-06-15 22:36:55 +00:00
Atsushi Eno 85b8e6cb11 2009-06-15 Atsushi Enomoto <[email protected]>
* Environment.cs : bump corlib version.

	* Normalization.cs : For NFC and NFKC, IsNormalized() was not working
	  enough to check composed characters. It's not possible without
	  the actual composition, so just call Normalize() and compare them.
	  In Normalize() mapping helper didn't pick correct map index since
	  the table for index stores index for "uncompressed" numbers.
	* NormalizationTableUtil.cs : updated to the latest UCD.
	* Makefile : to build test, source file must be downloaded too.

	* StringTest.cs : added string normalization test.


svn path=/trunk/mcs/; revision=136100
2009-06-15 08:57:18 +00:00
Zoltan Varga 9a7ea4a60a 2009-03-23 Zoltan Varga <[email protected]>
* StringTest.cs (LastIndexOfStringComparison): Add a test for #486234.

svn path=/trunk/mcs/; revision=130038
2009-03-23 11:20:30 +00:00
Marek Safar 874dce3c5f 2008-07-04 Marek Safar <[email protected]>
* StringTest.cs: Removed NotWorking flags.


svn path=/trunk/mcs/; revision=107233
2008-07-04 10:19:17 +00:00
Andreas N f5b5011be2 should not have gotten commited (from internal dev tests)
svn path=/trunk/mcs/; revision=104988
2008-06-05 11:37:22 +00:00
Andreas N fa38076273 2008-06-05 Andreas Nahr <[email protected]>
* StringTest.cs: Move Split Tests to single location
	* *.cs: Disable expected warnings

svn path=/trunk/mcs/; revision=104962
2008-06-05 08:49:52 +00:00
Andreas N 52913ae0bf 2008-06-02 Andreas Nahr <[email protected]>
* StringTest.cs: Small typo fix

svn path=/trunk/mcs/; revision=104960
2008-06-05 07:31:21 +00:00
Andreas N 0d3b98232d 2008-06-05 Andreas Nahr <[email protected]>
* String.cs: Managed replacement for Replace method ;)

svn path=/trunk/mcs/; revision=104959
2008-06-05 07:24:16 +00:00
Juraj Skripsky 169c1ff0f6 2008-06-01 Juraj Skripsky <[email protected]>
* StringBuilder.cs (ToString): Use String.SubstringUnchecked instead
	of String.Substring, as the former is guaranteed to create a new
	string object. Fixes bug #395904.

	* String.cs (Substring): Blocking bug #395904 has been fixed,
	re-enable optimization.

	* StringTest.cs (Substring2): Blocking bug #395904 has been fixed,
	re-enable test.


svn path=/trunk/mcs/; revision=104629
2008-06-01 17:57:48 +00:00
Andreas N 2c2df72478 2008-05-24 Andreas Nahr <[email protected]>
* StringTest.cs: Comment out a test that currently fails by checking for
	an obsolete parameter name in an exception (that doesn't even match the existing one)

svn path=/trunk/mcs/; revision=104621
2008-06-01 10:13:22 +00:00
Andreas N 01cd293d6c 2008-06-01 Andreas Nahr <[email protected]>
* String.cs: Replace Split IndexOf

svn path=/trunk/mcs/; revision=104620
2008-06-01 09:12:21 +00:00
Gert Driesen 6124c1c461 * StringTest.cs: Added/improved tests for ToLower and ToUpper.
svn path=/trunk/mcs/; revision=104011
2008-05-25 07:33:26 +00:00
Gert Driesen f69dc78429 * String.cs: Comment out 2.0 compatibility fix for SubString, since it
causes regressions in System.Xml.
* StringTest.cs: Comment out assert in SubString2 as corresponding
fix was reverted.

svn path=/trunk/mcs/; revision=103994
2008-05-24 20:04:53 +00:00