New tests, updates
[mono.git] / mcs / class / System.XML / Test / System.Xml.XPath / XPathNavigatorEvaluateTests.cs
index 0d8f70aa9f1882cfe6749d7ab7379282950fa0e1..359ba7197acc7c52c736506d98c86d1679a1cea4 100644 (file)
@@ -47,18 +47,20 @@ namespace MonoTests.System.Xml
 
                // Testing Core Funcetion Library functions defined at: http://www.w3.org/TR/xpath#corelib
                [Test]
-#if NET_2_0
+#if !NET_2_0
                // .NET 2.0 is fixed for last() to return 1 for the
-               // initial context position. We should follow the fix.
-               [Category ("NotWorking")]
+               // initial context position. Someone thinks we should follow
+               // the fix, but in reality we should just discard this
+               // pointless test. The positional value under those conditions
+               // does not make any sense.
                [Category ("NotDotNet")]
 #endif
                public void CoreFunctionNodeSetLast ()
                {
                        expression = navigator.Compile("last()");
                        iterator = navigator.Select("/foo");
-                       AssertEquals ("0", navigator.Evaluate ("last()").ToString());
-                       AssertEquals ("0", navigator.Evaluate (expression, null).ToString ());
+                       AssertEquals ("1", navigator.Evaluate ("last()").ToString());
+                       AssertEquals ("1", navigator.Evaluate (expression, null).ToString ());
                        AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
                        iterator = navigator.Select("/foo/*");
                        AssertEquals ("4", navigator.Evaluate (expression, iterator).ToString ());
@@ -67,18 +69,21 @@ namespace MonoTests.System.Xml
                }
 
                [Test]
-#if NET_2_0
+#if !NET_2_0
                // .NET 2.0 is fixed for position() to return 1 for the
-               // initial context position. We should follow the fix.
-               [Category ("NotWorking")]
+               // initial context position. Someone thinks we should follow
+               // the fix, but in reality we should just discard this
+               // pointless test. The positional value under those conditions
+               // does not make any sense.
+//             [Category ("NotWorking")]
                [Category ("NotDotNet")]
 #endif
                public void CoreFunctionNodeSetPosition ()
                {
                        expression = navigator.Compile("position()");
                        iterator = navigator.Select("/foo");
-                       AssertEquals ("#1", "0", navigator.Evaluate ("position()").ToString ());
-                       AssertEquals ("#2", "0", navigator.Evaluate (expression, null).ToString ());
+                       AssertEquals ("#1", "1", navigator.Evaluate ("position()").ToString ());
+                       AssertEquals ("#2", "1", navigator.Evaluate (expression, null).ToString ());
                        AssertEquals ("#3", "0", navigator.Evaluate (expression, iterator).ToString ());
                        iterator = navigator.Select("/foo/*");
                        AssertEquals ("#4", "0", navigator.Evaluate (expression, iterator).ToString ());