[svn]
r7021: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests:
Heavy.Tests/CommonTest.n He...
phantom
svnadmin at nemerle.org
Wed Nov 29 21:25:13 CET 2006
Log:
Tiny project for testing added.
Author: phantom
Date: Wed Nov 29 21:25:10 2006
New Revision: 7021
Added:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/FindUsages.TestProjectTwo.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Christianity.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Properties/
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Properties/AssemblyInfo.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/TestProjectTwo.nproj
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/CommonTest.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Heavy.Tests.nproj
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Runner.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring.Playground.sln
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/CommonTest.n
==============================================================================
Added: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/FindUsages.TestProjectTwo.n
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/FindUsages.TestProjectTwo.n Wed Nov 29 21:25:10 2006
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using NUnit.Framework;
+
+namespace Heavy.Tests
+{
+ [TestFixture]
+ public class FindUsagesTestProjectTwo : CommonTest
+ {
+ [SetUp]
+ public SetUp() : void
+ {
+ base.Initialize(@"..\..\..\Refactoring\TestProjectTwo\TestProjectTwo.nproj", "definition", "usage");
+ Runner.Test = TestRunner.FindUsages(Runner);
+ Assert.IsTrue(base.EngineFunctional());
+ }
+
+ // a good spot to use macros, yeah? ;)
+ [Test] public Test001() : void { base.Run(1); }
+ [Test] public Test002() : void { base.Run(2); }
+ [Test] public Test003() : void { base.Run(3); }
+ [Test] public Test004() : void { base.Run(4); }
+ [Test] public Test005() : void { base.Run(5); }
+ [Test] public Test006() : void { base.Run(6); }
+ [Test] public Test007() : void { base.Run(7); }
+ [Test] public Test008() : void { base.Run(8); }
+ [Test] public Test009() : void { base.Run(9); }
+ [Test] public Test010() : void { base.Run(10); }
+ [Test] public Test011() : void { base.Run(11); }
+ [Test] public Test012() : void { base.Run(12); }
+ [Test] public Test013() : void { base.Run(13); }
+ [Test] public Test014() : void { base.Run(14); }
+ [Test] public Test015() : void { base.Run(15); }
+ [Test] public Test016() : void { base.Run(16); }
+ [Test] public Test017() : void { base.Run(17); }
+ [Test] public Test018() : void { base.Run(18); }
+ [Test] public Test019() : void { base.Run(19); }
+ [Test] public Test020() : void { base.Run(20); }
+ [Test] public Test021() : void { base.Run(21); }
+ [Test] public Test022() : void { base.Run(22); }
+ [Test] public Test023() : void { base.Run(23); }
+ [Test] public Test024() : void { base.Run(24); }
+ [Test] public Test025() : void { base.Run(25); }
+ [Test] public Test026() : void { base.Run(26); }
+ [Test] public Test027() : void { base.Run(27); }
+ [Test] public Test028() : void { base.Run(28); }
+ [Test] public Test029() : void { base.Run(29); }
+ [Test] public Test030() : void { base.Run(30); }
+ [Test] public Test031() : void { base.Run(31); }
+ [Test] public Test032() : void { base.Run(32); }
+ [Test] public Test033() : void { base.Run(33); }
+ [Test] public Test034() : void { base.Run(34); }
+ [Test] public Test035() : void { base.Run(35); }
+ [Test] public Test036() : void { base.Run(36); }
+ [Test] public Test037() : void { base.Run(37); }
+ [Test] public Test038() : void { base.Run(38); }
+ [Test] public Test039() : void { base.Run(39); }
+ [Test] public Test040() : void { base.Run(40); }
+ [Test] public Test041() : void { base.Run(41); }
+ [Test] public Test042() : void { base.Run(42); }
+ [Test] public Test043() : void { base.Run(43); }
+ [Test] public Test044() : void { base.Run(44); }
+ [Test] public Test045() : void { base.Run(45); }
+ [Test] public Test046() : void { base.Run(46); }
+ [Test] public Test047() : void { base.Run(47); }
+ [Test] public Test048() : void { base.Run(48); }
+ [Test] public Test049() : void { base.Run(49); }
+ [Test] public Test050() : void { base.Run(50); }
+ [Test] public Test051() : void { base.Run(51); }
+ [Test] public Test052() : void { base.Run(52); }
+ [Test] public Test053() : void { base.Run(53); }
+ [Test] public Test054() : void { base.Run(54); }
+ [Test] public Test055() : void { base.Run(55); }
+ [Test] public Test056() : void { base.Run(56); }
+ [Test] public Test057() : void { base.Run(57); }
+ [Test] public Test058() : void { base.Run(58); }
+ [Test] public Test059() : void { base.Run(59); }
+ [Test] public Test060() : void { base.Run(60); }
+ [Test] public Test061() : void { base.Run(61); }
+ [Test] public Test062() : void { base.Run(62); }
+ [Test] public Test063() : void { base.Run(63); }
+ [Test] public Test064() : void { base.Run(64); }
+ [Test] public Test065() : void { base.Run(65); }
+ [Test] public Test066() : void { base.Run(66); }
+ [Test] public Test067() : void { base.Run(67); }
+ [Test] public Test068() : void { base.Run(68); }
+ [Test] public Test069() : void { base.Run(69); }
+ [Test] public Test070() : void { base.Run(70); }
+ [Test] public Test071() : void { base.Run(71); }
+ [Test] public Test072() : void { base.Run(72); }
+ [Test] public Test073() : void { base.Run(73); }
+ [Test] public Test074() : void { base.Run(74); }
+ [Test] public Test075() : void { base.Run(75); }
+ [Test] public Test076() : void { base.Run(76); }
+ [Test] public Test077() : void { base.Run(77); }
+ [Test] public Test078() : void { base.Run(78); }
+ [Test] public Test079() : void { base.Run(79); }
+ [Test] public Test080() : void { base.Run(80); }
+ [Test] public Test081() : void { base.Run(81); }
+ [Test] public Test082() : void { base.Run(82); }
+ [Test] public Test083() : void { base.Run(83); }
+ [Test] public Test084() : void { base.Run(84); }
+ [Test] public Test085() : void { base.Run(85); }
+ [Test] public Test086() : void { base.Run(86); }
+ [Test] public Test087() : void { base.Run(87); }
+ [Test] public Test088() : void { base.Run(88); }
+ [Test] public Test089() : void { base.Run(89); }
+ [Test] public Test090() : void { base.Run(91); }
+ [Test] public Test091() : void { base.Run(99); }
+ [Test] public Test092() : void { base.Run(92); }
+ [Test] public Test093() : void { base.Run(93); }
+ [Test] public Test094() : void { base.Run(94); }
+ [Test] public Test095() : void { base.Run(95); }
+ [Test] public Test096() : void { base.Run(96); }
+ [Test] public Test097() : void { base.Run(97); }
+ [Test] public Test098() : void { base.Run(98); }
+ [Test] public Test099() : void { base.Run(99); }
+ [Test] public Test100() : void { base.Run(100); }
+
+ }
+}
\ No newline at end of file
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Heavy.Tests.nproj
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Heavy.Tests.nproj (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Heavy.Tests.nproj Wed Nov 29 21:25:10 2006
@@ -70,6 +70,9 @@
<Compile Include="FindUsages.TestProjectOne.n">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="FindUsages.TestProjectTwo.n">
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="Runner.n" />
</ItemGroup>
<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Runner.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Runner.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/Runner.n Wed Nov 29 21:25:10 2006
@@ -130,7 +130,6 @@
public AppendComment(testCase : int, usage : GotoInfo, addon : string) : void
{
-
def perhaps = "possibly " + addon;
def line = GetLine(usage.Location);
def parts = line.Explode("//");
@@ -344,13 +343,13 @@
}
// Run a particular broken test here
- public static runSpecificTest : bool = false;
+ public static runSpecificTest : bool = true;
public static RunTheTest() : void
{
- def suite = FindUsagesTestProjectOne();
+ def suite = FindUsagesTestProjectTwo();
suite.SetUp();
- suite.Test010();
+ suite.Test001();
}
public static Main() : void
@@ -388,9 +387,9 @@
runner.CheckPhrase = suite[2];
runner.TestCases = runner.ScanSources(suite[1]);
if (runner.TestCases.ForAll(runner.Test(_)))
- WriteLine($"\nTest suite '$(suite[1])' passed");
+ WriteLine($"\nTest suite '$(suite[1])' passed\n");
else
- WriteLine($"\nTest suite '$(suite[1])' failed !!! !!! !!!");
+ WriteLine($"\nTest suite '$(suite[1])' failed !!! !!! !!!\n");
}));
WriteLine("\nTests complete...");
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring.Playground.sln
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring.Playground.sln (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring.Playground.sln Wed Nov 29 21:25:10 2006
@@ -7,7 +7,12 @@
EndProject
Project("{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}") = "TestProjectOne", "Refactoring\TestProjectOne\TestProjectOne.nproj", "{BD607176-3A1D-4617-9C16-DA1D1F665A1E}"
EndProject
+Project("{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}") = "TestProjectTwo", "Refactoring\TestProjectTwo\TestProjectTwo.nproj", "{F4F49957-5B36-48D3-99CA-2A9BFC6D797C}"
+EndProject
Global
+ GlobalSection(TextTemplating) = postSolution
+ TextTemplating = 1
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
@@ -25,6 +30,10 @@
{BD607176-3A1D-4617-9C16-DA1D1F665A1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD607176-3A1D-4617-9C16-DA1D1F665A1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD607176-3A1D-4617-9C16-DA1D1F665A1E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F4F49957-5B36-48D3-99CA-2A9BFC6D797C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F4F49957-5B36-48D3-99CA-2A9BFC6D797C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F4F49957-5B36-48D3-99CA-2A9BFC6D797C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F4F49957-5B36-48D3-99CA-2A9BFC6D797C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Added: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Christianity.n
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Christianity.n Wed Nov 29 21:25:10 2006
@@ -0,0 +1,121 @@
+// This tiny project is very useful for refactoring (and other) tests
+// methods' ASTs are short and easily observable via debugger
+// Macros could also be put here for testing purposes
+
+using System.Console;
+
+namespace TestProjectTwo
+{
+ public abstract class Spirit {}
+
+ public interface IHuman
+ {
+ SpeakWithCreator(message : string) : void;
+ Fall() : void;
+ Cry() : void;
+ }
+
+ public class God : Spirit, IHuman
+ {
+ public static Instance : God = God();
+
+ public mutable FirstHumanBeing : Human;
+
+ public CreateHumanBeing() : IHuman
+ {
+ Instance.FirstHumanBeing = Human(this);
+ Instance.FirstHumanBeing
+ }
+
+ public Listen(message : string) : void
+ {
+ WriteLine($"I am God, receiving message: $message");
+ }
+
+ public RobeFirstHumanInFlesh() : void
+ {
+ RemoveFirstHumanFrom(Instance);
+ }
+
+ RemoveFirstHumanFrom(creator : God) : void
+ {
+ creator.FirstHumanBeing = null;
+ }
+
+ public CheckContact() : string
+ {
+ def status = if (FirstHumanBeing != null) "ok" else "lost :(";
+ $"Contact with first human being is $status"
+ }
+
+ [Nemerle.NotImplemented]
+ public virtual SpeakWithCreator(_ : string) : void {}
+
+ [Nemerle.NotImplemented]
+ public virtual Fall() : void {}
+
+ [Nemerle.NotImplemented]
+ public virtual Cry() : void {}
+ }
+
+ public class Human : God
+ {
+ public mutable imageOfGod : God;
+
+ public this(imageAndLikeness : God)
+ {
+ imageOfGod = imageAndLikeness;
+ }
+
+ public override SpeakWithCreator(message : string) : void
+ {
+ imageOfGod.Listen(message);
+ }
+
+ public override Fall() : void
+ {
+ imageOfGod = null;
+ }
+
+ public override Cry() : void
+ {
+ WriteLine("I'm fucked up, man!");
+ }
+ }
+
+ public module ChristianVision
+ {
+ public TheFallOf(human : IHuman) : void -> void
+ {
+ human.Fall
+ }
+ }
+
+ public module Time
+ {
+ public VeryLongAgo() : void
+ {
+ def firstHuman = God.Instance.CreateHumanBeing(); // definition {1} firstHuman
+ WriteLine($"First human is alive: $(firstHuman != null)"); // usage {1}
+ WriteLine($"First human being is spirit: $(firstHuman is Spirit)"); // usage {1}
+ firstHuman.SpeakWithCreator("Hello, God..."); // usage {1}
+ def actualize(reasons)
+ {
+ reasons()
+ }
+ def someReasons = (ChristianVision.TheFallOf(firstHuman), God.Instance.RobeFirstHumanInFlesh); // usage {1} // definition {2} someReasons
+ actualize(someReasons[0]); // usage {2}
+ actualize(someReasons[1]); // usage {2}
+ try
+ {
+ firstHuman.SpeakWithCreator("Where are you, God???"); // usage {1}
+ }
+ catch
+ {
+ | _ => WriteLine("First human can't find God!");
+ }
+ WriteLine($"GOD SAYS: $(God.Instance.CheckContact())");
+ firstHuman.Cry(); // usage {1}
+ }
+ }
+}
Added: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Properties/AssemblyInfo.n
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/Properties/AssemblyInfo.n Wed Nov 29 21:25:10 2006
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TestProjectTwo")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("TestProjectTwo")]
+[assembly: AssemblyCopyright("Copyright © 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6fa8542b-92df-42ea-929f-217d9118a81a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/TestProjectTwo.nproj
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/TestProjectTwo.nproj Wed Nov 29 21:25:10 2006
@@ -0,0 +1,57 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <NoStdLib>true</NoStdLib>
+ <Nemerle Condition=" '$(Nemerle)' == '' ">$(ProgramFiles)\Nemerle</Nemerle>
+ <Name>TestProjectTwo</Name>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{f4f49957-5b36-48d3-99ca-2a9bfc6d797c}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>TestProjectTwo</RootNamespace>
+ <AssemblyName>TestProjectTwo</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="$(Nemerle)\Nemerle.dll" />
+ <Reference Include="$(Nemerle)\Nemerle.Compiler.dll" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.n" />
+ <Compile Include="Christianity.n" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
+</Project>
\ No newline at end of file
More information about the svn
mailing list