diff options
author | Sureshkumar T <suresh@mono-cvs.ximian.com> | 2005-09-20 15:42:55 +0400 |
---|---|---|
committer | Sureshkumar T <suresh@mono-cvs.ximian.com> | 2005-09-20 15:42:55 +0400 |
commit | c0195c9819c1762aacb891410140b2a117447eb2 (patch) | |
tree | 1f51551e9076e2222233b5ab6ec07636ed95296e /mcs/class/System.Data/Test | |
parent | 990e2d99ec11abf152c1f68747bf9dcf1c64643a (diff) |
2005-09-20 Sureshkumar T <tsureshkumar@novell.com>
* System.Data/DataTable.cs (ParseSortString): Patch from Marc Haisenko for
allowing [ & ] in DataView.Sort string.
* Test/System.Data/DataViewTest.cs: Added a case for Sort to accept columns with
'[' & ']'.
svn path=/trunk/mcs/; revision=50289
Diffstat (limited to 'mcs/class/System.Data/Test')
-rw-r--r-- | mcs/class/System.Data/Test/System.Data/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Data/Test/System.Data/DataViewTest.cs | 25 |
2 files changed, 29 insertions, 1 deletions
diff --git a/mcs/class/System.Data/Test/System.Data/ChangeLog b/mcs/class/System.Data/Test/System.Data/ChangeLog index 50af590b95a..02f85d517c3 100644 --- a/mcs/class/System.Data/Test/System.Data/ChangeLog +++ b/mcs/class/System.Data/Test/System.Data/ChangeLog @@ -1,3 +1,8 @@ +2005-09-20 Sureshkumar T <tsureshkumar@novell.com> + + * DataViewTest.cs: Added a case for Sort to accept columns with + '[' & ']'. + 2005-08-02 Sureshkumar T <tsureshkumar@novell.com> * DataTableTest.cs: Select (): added a case for apos escaping. diff --git a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs index 3e7dd8fbb44..730a110434f 100644 --- a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs @@ -5,6 +5,7 @@ // Patrick Kalkman kalkman@cistron.nl // Umadevi S (sumadevi@novell.com) // Atsushi Enomoto (atsushi@ximian.com) +// Sureshkumar T <tsureshkumar@novell.com> // // (C) 2003 Patrick Kalkman // @@ -224,8 +225,10 @@ namespace MonoTests.System.Data AssertEquals ("Deleted.Value", "1", v); } + + #region Sort Tests [Test] - public void Sort () + public void SortTest () { dataView.Sort = "itemName DESC"; AssertEquals ("test#01",ListChangedType.Reset,listChangedArgs.ListChangedType); @@ -233,6 +236,26 @@ namespace MonoTests.System.Data // PrintTableOrView (dataView); } + + [Test] + public void SortTestWeirdColumnName () + { + DataTable dt = new DataTable (); + dt.Columns.Add ("id]", typeof (int)); + dt.Columns.Add ("[id", typeof (int)); + + DataView dv = dt.DefaultView; + dv.Sort = "id]"; + //dv.Sort = "[id"; // this is not allowed + dv.Sort = "[id]]"; + dv.Sort = "[[id]"; + dv.Sort = "id] ASC"; + dv.Sort = "[id]] DESC"; + dv.Sort = "[[id] ASC"; + } + + #endregion // Sort Tests + [Test] [ExpectedException(typeof(DataException))] public void AddNew_1 () |