[svn] r7069: vs-plugin/trunk: ConsoleTest/Program.cs Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Cont...

VladD2 svnadmin at nemerle.org
Thu Dec 7 07:13:33 CET 2006


Log:
Add unit tests.

Author: VladD2
Date: Thu Dec  7 07:13:15 2006
New Revision: 7069

Modified:
   vs-plugin/trunk/ConsoleTest/Program.cs
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n

Modified: vs-plugin/trunk/ConsoleTest/Program.cs
==============================================================================
--- vs-plugin/trunk/ConsoleTest/Program.cs	(original)
+++ vs-plugin/trunk/ConsoleTest/Program.cs	Thu Dec  7 07:13:15 2006
@@ -12,6 +12,9 @@
 			Test1 test = new Test1();
 			test.Init();
 
+			test.Complete_System_Collections_Generic_List__Collections();
+			test.Complete_namespace_2();
+			test.Complete_Complete_expr();
 			test.Complete_type_escalation_3();
 			test.Complete_Complete_aliased_type();
 			test.Complete_ExtensionMethod_1();
@@ -38,7 +41,7 @@
 			test.QuickTip_ClassExtension();
 			test.Complete_generic_type_cast();
 			test.Complete_type_cast();
-			test.Complete_namespace();
+			test.Complete_namespace_1();
 			test.Complete_vars_with_same_name();
 			test.Complete_in_match_variant_3();
 			test.Complete_in_match_variant_2();

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n	Thu Dec  7 07:13:15 2006
@@ -71,7 +71,7 @@
 
         public Method8() : void
         {
-          System.Console./*Complete namespace:-0*/
+          System.Console./*Complete namespace 1:-0*/
         }
 
         public Method9() : void
@@ -122,6 +122,22 @@
           _ = ary.Ma/*ExtensionMethod_1:-0*/
         }
 
+        public Method16() : void
+        {
+          def _ = System.Text.RegularExpressions.Regex("--.*")./*Complete expr:-0*/;
+        }
+
+        public Method17() : void
+        {
+          System.Collections.Tex/*Complete namespace 2:-0*/
+        }
+
+        public Method18() : void
+        {
+          def xx = /*Complete System.Collections.Generic.List/Collections:12*/System.Collections.Generic.List();
+          _ = xx;
+        }
+
         xxx : TestVariant2;
       }
     }

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n	Thu Dec  7 07:13:15 2006
@@ -16,6 +16,36 @@
   public partial class Test1
   {
     [Test]
+    public Complete_System_Collections_Generic_List__Collections() : void
+    {
+      def file = FilePath1;
+      def (line, col) = ReadLocation(file, "Complete System.Collections.Generic.List/Collections");
+      def result = _project.CompleteWord(file, line, col, TestSourceTextManager(file));
+      Assert.IsNotNull(result, "result is null");
+      Assert.AreEqual(result.Length, 1);
+    }
+
+    [Test]
+    public Complete_namespace_2() : void
+    {
+      def file = FilePath1;
+      def (line, col) = ReadLocation(file, "Complete namespace 2");
+      def result = _project.CompleteWord(file, line, col, TestSourceTextManager(file));
+      Assert.IsNotNull(result, "result is null");
+      Assert.AreEqual(result.Length, 1);
+    }
+
+    [Test]
+    public Complete_Complete_expr() : void
+    {
+      def file = FilePath1;
+      def (line, col) = ReadLocation(file, "Complete expr");
+      def result = _project.CompleteWord(file, line, col, TestSourceTextManager(file));
+      Assert.IsNotNull(result, "result is null");
+      Assert.AreEqual(result.Length, 18);
+    }
+
+    [Test]
     public Complete_ExtensionMethod_1() : void
     {
       def file = FilePath1;
@@ -227,10 +257,10 @@
     }
 
     [Test]
-    public Complete_namespace() : void
+    public Complete_namespace_1() : void
     {
       def file = FilePath1;
-      def (line, col) = ReadLocation(file, "Complete namespace");
+      def (line, col) = ReadLocation(file, "Complete namespace 1");
       def result = _project.CompleteWord(file, line, col, TestSourceTextManager(file));
       Assert.IsNotNull(result, "result is null");
       Assert.Greater(result.Length, 0);



More information about the svn mailing list