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
4 changed files
with
63 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.Composition; | ||
using System.Text; | ||
using Vim.EditorHost; | ||
using Vim.UI.Wpf.Implementation.Misc; | ||
using Vim.UnitTest; | ||
using Xunit; | ||
|
||
namespace VimCoreTest | ||
{ | ||
/// <summary> | ||
/// Test that we don't break the Vim Mac implementation as much as possible until we can get | ||
/// full Mac testing support https://github.com/VsVim/VsVim/issues/2907 | ||
/// </summary> | ||
public sealed class MacTest | ||
{ | ||
[WpfFact] | ||
public void Composition() | ||
{ | ||
var baseTypeFilter = VimTestBase.GetVimEditorHostTypeFilter(typeof(TestableVimHost)); | ||
Func<Type, bool> typeFilter = (type) => | ||
{ | ||
if (type.GetCustomAttributes(typeof(ExportAttribute), inherit: false).Length > 0) | ||
{ | ||
if (!baseTypeFilter(type)) | ||
{ | ||
return false; | ||
} | ||
if (type.FullName.StartsWith("Vim.UI.Wpf")) | ||
{ | ||
if (type != typeof(DisplayWindowBrokerFactoryService) && | ||
type != typeof(AlternateKeyUtil)) | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
}; | ||
|
||
var factory = new VimEditorHostFactory(typeFilter); | ||
var host = factory.CreateVimEditorHost(); | ||
var textView = host.CreateTextView(""); | ||
host.Vim.AutoLoadVimRc = false; | ||
var vimBuffer = host.Vim.CreateVimBuffer(textView); | ||
vimBuffer.Process("ihello Mac"); | ||
Assert.Equal("hello Mac", textView.TextBuffer.GetLineText(0)); | ||
} | ||
} | ||
} |
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