[svn] r6927: vs-plugin/trunk: ConsoleTest/Program.cs
Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/...
VladD2
svnadmin at nemerle.org
Fri Nov 17 18:49:50 CET 2006
Log:
Change tests. Add comments.
Author: VladD2
Date: Fri Nov 17 18:49:46 2006
New Revision: 6927
Modified:
vs-plugin/trunk/ConsoleTest/Program.cs
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1-2.n
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 Fri Nov 17 18:49:46 2006
@@ -12,6 +12,7 @@
Test1 test = new Test1();
test.Init();
+ test.QuickTips();
test.Property_location();
test.QuickTip_Imperative();
test.QuickTip_StackOverflow();
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n Fri Nov 17 18:49:46 2006
@@ -243,7 +243,7 @@
break;
#endif
- //method.ResetBody(); //HACK!!!
+ method.ResetBody(); //HACK!!!
def pExpr = method.BodyParsed;
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 Fri Nov 17 18:49:46 2006
@@ -17,9 +17,11 @@
| CValue(sv) /*ArgPattern:-8*/ => sv;
}
- p1 : int * list[string * XStruct] /*TupleProp:-5*/
+ [System.CLSCompliant(true)]
+ public p1[_ : string] : int * list[string * XStruct] /*TupleProp:-5*/
{
get { (0, [("str", XStruct())]) }
+ set { }
}
public MethodInPart2() : string
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 Fri Nov 17 18:49:46 2006
@@ -184,16 +184,17 @@
class Class5
{
- public/*PropStartLocation*/ Prop
+ /*PropStartLocation*/public Prop
: int
- {/*PropBodyLocation*/
+ {/*PropBodyStartLocation:-0*/
+ [System.CLSCompliant(true)]
get { 0 }
set { }
//
/*
*/
- }/*PropEndLocation*/
+ }/*PropBodyEndLocation:-1*/
public Test() : 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 Fri Nov 17 18:49:46 2006
@@ -430,6 +430,60 @@
Test();
}
+ // VladD2: Íå íàäî óäàëÿòü îòëàæåííûå òåñòû. Íå ôàêò, ÷òî äðóãèå òåñòû ïîêðûâàþò
+ // èõ ôóíêöèîíàëüíîñòü.
+ [Test]
+ public QuickTip_TupleMethod() : void
+ {
+ def file = FilePath2;
+ def (line, col) = ReadLocation(file, "TupleMethod");
+
+ def result = _project.GetQuickTipInfo(file, line, col);
+
+ Assert.IsNotNull(result, "result is null");
+ WriteLine(result.Text);
+ Assert.AreEqual (result.Text.Split('\n')[0], "internal sealed struct XStruct");
+ }
+
+ [Test]
+ public QuickTip_TupleProp() : void
+ {
+ def file = FilePath2;
+ def (line, col) = ReadLocation(file, "TupleProp");
+
+ def result = _project.GetQuickTipInfo(file, line, col);
+
+ Assert.IsNotNull(result, "result is null");
+ WriteLine(result.Text);
+ Assert.AreEqual (result.Text.Split('\n')[0], "internal sealed struct XStruct");
+ }
+
+ [Test]
+ public QuickTip_CtorArg() : void
+ {
+ def file = FilePath2;
+ def (line, col) = ReadLocation(file, "CtorArg");
+
+ def result = _project.GetQuickTipInfo(file, line, col);
+
+ Assert.IsNotNull(result, "result is null");
+ WriteLine(result.Text);
+ Assert.AreEqual (result.Text.Split('\n')[0], "internal sealed struct XStruct");
+ }
+
+ [Test]
+ public QuickTip_ArgPattern() : void
+ {
+ def file = FilePath2;
+ def (line, col) = ReadLocation(file, "ArgPattern");
+
+ def result = _project.GetQuickTipInfo(file, line, col);
+
+ Assert.IsNotNull(result, "result is null");
+ WriteLine(result.Text);
+ Assert.AreEqual (result.Text.Split('\n')[0], "internal sealed variant option TestVariant2.CValue");
+ }
+
//[Test]
public QuickTip_StackOverflow() : void
{
@@ -464,26 +518,32 @@
def tb = (decl :> Decl.Type).Builder;
def prop = tb.GetActiveMember(Location.GetFileIndex(file), line, col);
- CheckProperty(prop, "Method");
+ CheckProperty(prop, "Prop");
def prop = prop :> PropertyBuilder;
Assert.AreEqual(prop.Location.Line, line);
- Assert.AreEqual(prop.Location.Column, col - 8);
+ Assert.AreEqual(prop.Location.Column, col);
- def (line, col) = ReadLocation(file, "PropBodyLocation");
+ def (line, col) = ReadLocation(file, "PropBodyStartLocation");
Assert.AreEqual(prop.BodyLocation.Line, line);
- Assert.AreEqual(prop.BodyLocation.Column, col - 2);
+ Assert.AreEqual(prop.BodyLocation.Column, col);
def (line, col) = ReadLocation(file, "PropEndLocation");
- Assert.AreEqual(prop.Location.Line, line);
- Assert.AreEqual(prop.Location.Column, col - 2);
Assert.AreEqual(prop.BodyLocation.Line, line);
- Assert.AreEqual(prop.BodyLocation.Column, col - 3);
+ Assert.AreEqual(prop.BodyLocation.Column, col);
+ Assert.AreEqual(prop.Location.Line, line);
+ Assert.AreEqual(prop.Location.Column, col + 1);
}
+ // ValdD2:
+ // Îòêðîâåííî ãîâîðÿ ïîäîáíàÿ àâòîìàòèçàöèÿ íè÷åãî õîðîøåãî íå íåñåò. Êàê îòëàæèâàòü
+ // òàêèå êîìïëåêñíûå òåñòû? Þíèò-òåñò íà òî è "þíèò", ÷òîáû ïîêðûâàòü îäó êîíêðåòíóþ
+ // ïðîáëåìó. Òîãäà åãî óäîáíî èñïîëüçîâàòü äëÿ îòëàäêè è åñëè ÷òî ñëó÷èòñÿ, òî ÿñíî
+ // ãäå è ñ ÷åì.
+ // È íóæíû òåñòû ïî GoTo.
[Test]
public QuickTips() : void
{
@@ -517,6 +577,5 @@
}
}
}
-
}
}
More information about the svn
mailing list