-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
171 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace XSVim.Tests | ||
|
||
open XSVim | ||
open NUnit.Framework | ||
|
||
[<TestFixture>] | ||
module ``Delete tests`` = | ||
[<Test>] | ||
let ``dd test``() = | ||
//TODO - caret finishes in wrong position | ||
let source = | ||
@"aaaaaa | ||
bb$bbbb | ||
cccccc | ||
dddddd | ||
eeeeee"; | ||
|
||
let expected = | ||
@"aaaaaa | ||
dddddd | ||
eeeeee"; | ||
//Assert.False true | ||
test source "Vjd" expected "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace XSVim.Tests | ||
|
||
open System | ||
open Mono.Addins | ||
open Mono.Addins.Description | ||
|
||
[<assembly:Addin ( | ||
"XSVim.Tests", | ||
Namespace = "XSVim.Tests", | ||
Version = "1.0" | ||
)>] | ||
|
||
[<assembly:AddinName ("XSVim.Tests")>] | ||
[<assembly:AddinCategory ("IDE extensions")>] | ||
[<assembly:AddinDescription ("XSVim.Tests")>] | ||
[<assembly:AddinAuthor ("jason")>] | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace XSVim.Tests | ||
open System.Reflection | ||
open System.Runtime.CompilerServices | ||
|
||
[<assembly: AssemblyTitle("XSVim.Tests")>] | ||
[<assembly: AssemblyDescription("")>] | ||
[<assembly: AssemblyConfiguration("")>] | ||
[<assembly: AssemblyCompany("")>] | ||
[<assembly: AssemblyProduct("")>] | ||
[<assembly: AssemblyCopyright("(c) Jason Imison")>] | ||
[<assembly: AssemblyTrademark("")>] | ||
|
||
// The assembly version has the format {Major}.{Minor}.{Build}.{Revision} | ||
|
||
[<assembly: AssemblyVersion("1.0.0.0")>] | ||
|
||
//[<assembly: AssemblyDelaySign(false)>] | ||
//[<assembly: AssemblyKeyFile("")>] | ||
|
||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ExtensionModel> | ||
<Runtime> | ||
</Runtime> | ||
</ExtensionModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace XSVim.Tests | ||
|
||
open System | ||
open System.Text | ||
open Mono.TextEditor | ||
open MonoDevelop.Ide.Editor.Extension | ||
open NUnit.Framework | ||
open XSVim | ||
|
||
[<AutoOpen>] | ||
module TestHelpers = | ||
let test (source:string) (keys:string) expected expectedMode = | ||
let editor = new TextEditorData() | ||
let caret = source.IndexOf "$" | ||
editor.Text <- source.Replace("$", "") | ||
editor.Caret.Offset <- caret | ||
editor.Caret.UpdateCaretOffset() | ||
let plugin = new XSVim() | ||
let state = { keys=[]; mode=NormalMode; visualStartOffset=0; findCharCommand=None; lastAction=[] } | ||
let newState = | ||
keys |> Seq.fold(fun state c -> | ||
let descriptor = KeyDescriptor.FromGtk(Gdk.Key.a (* important? *), c, Gdk.ModifierType.None) | ||
let newState, handledKeyPress = Vim.handleKeyPress state descriptor editor | ||
newState) state | ||
|
||
Assert.AreEqual(expected, editor.Text) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{3C522649-67F6-4F65-9CC9-D5847768FE68}</ProjectGuid> | ||
<ProjectTypeGuids>{86F6BF2A-E449-4B3E-813B-9ACC37E5545F};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>XSVim.Tests</RootNamespace> | ||
<AssemblyName>XSVim.Tests</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<TestRunnerCommand>..\..\monodevelop\main\build\bin\mdtool.exe</TestRunnerCommand> | ||
<TestRunnerArgs>run-md-tests</TestRunnerArgs> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<PlatformTarget></PlatformTarget> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<DefineConstants></DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<GenerateTailCalls>true</GenerateTailCalls> | ||
<PlatformTarget></PlatformTarget> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0' OR '$(VisualStudioVersion)' == '11.0'"> | ||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.fs" /> | ||
<Compile Include="Properties\AddinInfo.fs" /> | ||
<Compile Include="TestHelpers.fs" /> | ||
<Compile Include="DeleteTests.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="Properties\Manifest.addin.xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\XSVim\XSVim.fsproj"> | ||
<Project>{9DB313D4-4CD1-455F-846F-42CD234DE626}</Project> | ||
<Name>XSVim</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="GuiUnit"> | ||
<HintPath>..\..\monodevelop\main\build\tests\GuiUnit.exe</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<AddinReference Include="MonoDevelop.SourceEditor2" /> | ||
</ItemGroup> | ||
<Import Project="$(FSharpTargetsPath)" /> | ||
<Import Project="..\packages\MonoDevelop.Addins.0.3.3\build\net40\MonoDevelop.Addins.targets" Condition="Exists('..\packages\MonoDevelop.Addins.0.3.3\build\net40\MonoDevelop.Addins.targets')" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="MonoDevelop.Addins" version="0.3.3" targetFramework="net45" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters