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

VladD2 svnadmin at nemerle.org
Thu Sep 7 15:20:18 CEST 2006


Log:
Changes in tests.

Author: VladD2
Date: Thu Sep  7 15:19:36 2006
New Revision: 6624

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

Modified: vs-plugin/trunk/ConsoleTest/Program.cs
==============================================================================
--- vs-plugin/trunk/ConsoleTest/Program.cs	(original)
+++ vs-plugin/trunk/ConsoleTest/Program.cs	Thu Sep  7 15:19:36 2006
@@ -12,6 +12,7 @@
 			Test1 test = new Test1();
 			test.Init();
 
+			test.Overload1();
 			test.QuickTip_ClassExtension();
 			test.Complete_generic_type_cast();
 			test.Complete_type_cast();
@@ -27,7 +28,6 @@
 			test.Complete_GlabalNs_in_NestedNs();
 			test.FindByLocation_Ns1_Ns2_Ns3_ClassInNestenNs();
 			test.FindByLocation_Method_Class2_Method();
-			test.CompleteIn_NestedUsing();
 			test.CompleteInType_1();
 			test.CompleteInUsing_1();
 			test.FindByLocation_Method_Main();

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1-2.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1-2.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1-2.n	Thu Sep  7 15:19:36 2006
@@ -1,7 +1,6 @@
 using System.Console;
 using SCG = System.Collections.Generic;
 using Nemerle;
-using C/*Nested using:-0*/;
 
 namespace Tests
 {

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.Init.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.Init.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.Init.n	Thu Sep  7 15:19:36 2006
@@ -17,27 +17,28 @@
     [SetUp]
     public Init() : void
     {
-      def engine = Engine(TraceWriter());
+      _engine = Engine(TraceWriter());
 
-      def AddAssembly(name) { engine.References.Add(name, Assembly.Load(name)); }
+      def AddAssembly(name) { _engine.References.Add(name, Assembly.Load(name)); }
 
       AddAssembly("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
       AddAssembly("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
       AddAssembly("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
 
-      engine.Sources.AddOrUpdate(FilePath1, File.ReadAllText(FilePath1));
-      Assert.AreEqual(1, engine.Sources.Count, "Expected Failure.");
+      _engine.Sources.AddOrUpdate(FilePath1, File.ReadAllText(FilePath1));
+      Assert.AreEqual(1, _engine.Sources.Count, "Expected Failure.");
 
-      engine.Sources.AddOrUpdate(FilePath2, File.ReadAllText(FilePath2));
-      Assert.AreEqual(2, engine.Sources.Count, "Expected Failure.");
+      _engine.Sources.AddOrUpdate(FilePath2, File.ReadAllText(FilePath2));
+      Assert.AreEqual(2, _engine.Sources.Count, "Expected Failure.");
 
-      _project = engine.GetProject();
+      _project = _engine.GetProject();
       Assert.IsNotNull(_project, "_project is null");
     }
 
     FilePath1 = @"Nemerle.Completion2\Tests\Content\Class1.n";
     FilePath2 = @"Nemerle.Completion2\Tests\Content\Class1-2.n";
     mutable _project : Project;
+    mutable _engine : Engine;
 
     CheckType(decl : Decl, fullName : string) : void
     {

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 Sep  7 15:19:36 2006
@@ -14,6 +14,28 @@
   public partial class Test1
   {
     [Test]
+    public Overload1() : void
+    {
+      def file        = FilePath1;
+      def (line, col) = ReadLocation(file, "ClassExtension");
+
+      def Test()
+      {
+        def result = _project.GetQuickTipInfo(file, line, col, GetTextFromFile(file, _, _, _, _));
+
+        Assert.IsNotNull(result, "result is null");
+        WriteLine(result.Text);
+        Assert.AreEqual (result.Text.Split('\n')[0], "public static method ClassExtension.Foo(s : string) : int");
+      }
+
+      Test();
+      _project = _engine.GetProject();
+      Test();
+      _project = _engine.GetProject();
+      Test();
+    }
+
+    [Test]
     public Complete_generic_type_cast() : void
     {
       def file = FilePath1;
@@ -122,15 +144,6 @@
     }
 
     [Test]
-    public CompleteIn_NestedUsing() : void
-    {
-      def file = FilePath2;
-      def (line, col) = ReadLocation(file, "Nested using");
-      def decl = _project.CompleteWord(file, line, col, GetTextFromFile(file, _, _, _, _));
-      Assert.IsNotNull(decl, "decl is null");
-    }
-
-    [Test]
     public CompleteInType_1() : void
     {
       def file = FilePath1;

Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleLanguage.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleLanguage.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleLanguage.cs	Thu Sep  7 15:19:36 2006
@@ -174,7 +174,7 @@
 				projectInfo.Engine.ProcessMessages = true;
 				projectInfo.UpdateFile(request);
 
-				Project project = projectInfo.Engine.GetProject();
+				Project project = projectInfo.Project;
 
 				project.CheckErrors(
 					request.FileName,



More information about the svn mailing list