Skip to content

Commit

Permalink
Updated libraries and targeting builds for the test projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Latency committed Sep 25, 2017
1 parent 83def26 commit b42ac5c
Show file tree
Hide file tree
Showing 10 changed files with 476 additions and 512 deletions.
66 changes: 34 additions & 32 deletions ReadLine.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{06FC0E85-E73C-4DC1-B6FD-A583B7B1DFE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReadLine", "src\ReadLine\ReadLine.csproj", "{9EB290C9-BB52-4B24-9779-5A816AC75E18}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReadLine", "src\ReadLine\ReadLine.csproj", "{9EB290C9-BB52-4B24-9779-5A816AC75E18}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReadLine.Demo", "src\ReadLine.Demo\ReadLine.Demo.csproj", "{4C512FD1-A0E8-4908-B0A4-B0D85947716A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReadLine.Demo", "src\ReadLine.Demo\ReadLine.Demo.csproj", "{4C512FD1-A0E8-4908-B0A4-B0D85947716A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{38C56AEB-DB08-4CBF-AAC0-EBFC2B0EE045}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReadLine.Tests", "test\ReadLine.Tests\ReadLine.Tests.csproj", "{631582D9-EEEA-4F9D-8069-71ECA24ED282}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReadLine.Tests", "test\ReadLine.Tests\ReadLine.Tests.csproj", "{631582D9-EEEA-4F9D-8069-71ECA24ED282}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -22,50 +21,53 @@ Global
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x64.ActiveCfg = Debug|x64
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x64.Build.0 = Debug|x64
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x86.ActiveCfg = Debug|x86
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x86.Build.0 = Debug|x86
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x64.ActiveCfg = Debug|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x64.Build.0 = Debug|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x86.ActiveCfg = Debug|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Debug|x86.Build.0 = Debug|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|Any CPU.Build.0 = Release|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x64.ActiveCfg = Release|x64
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x64.Build.0 = Release|x64
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x86.ActiveCfg = Release|x86
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x86.Build.0 = Release|x86
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x64.ActiveCfg = Release|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x64.Build.0 = Release|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x86.ActiveCfg = Release|Any CPU
{9EB290C9-BB52-4B24-9779-5A816AC75E18}.Release|x86.Build.0 = Release|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x64.ActiveCfg = Debug|x64
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x64.Build.0 = Debug|x64
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x86.ActiveCfg = Debug|x86
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x86.Build.0 = Debug|x86
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x64.ActiveCfg = Debug|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x64.Build.0 = Debug|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x86.ActiveCfg = Debug|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Debug|x86.Build.0 = Debug|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|Any CPU.Build.0 = Release|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x64.ActiveCfg = Release|x64
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x64.Build.0 = Release|x64
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x86.ActiveCfg = Release|x86
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x86.Build.0 = Release|x86
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x64.ActiveCfg = Release|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x64.Build.0 = Release|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x86.ActiveCfg = Release|Any CPU
{4C512FD1-A0E8-4908-B0A4-B0D85947716A}.Release|x86.Build.0 = Release|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|Any CPU.Build.0 = Debug|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x64.ActiveCfg = Debug|x64
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x64.Build.0 = Debug|x64
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x86.ActiveCfg = Debug|x86
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x86.Build.0 = Debug|x86
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x64.ActiveCfg = Debug|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x64.Build.0 = Debug|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x86.ActiveCfg = Debug|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Debug|x86.Build.0 = Debug|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|Any CPU.ActiveCfg = Release|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|Any CPU.Build.0 = Release|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x64.ActiveCfg = Release|x64
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x64.Build.0 = Release|x64
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x86.ActiveCfg = Release|x86
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x86.Build.0 = Release|x86
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x64.ActiveCfg = Release|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x64.Build.0 = Release|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x86.ActiveCfg = Release|Any CPU
{631582D9-EEEA-4F9D-8069-71ECA24ED282}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9EB290C9-BB52-4B24-9779-5A816AC75E18} = {06FC0E85-E73C-4DC1-B6FD-A583B7B1DFE4}
{4C512FD1-A0E8-4908-B0A4-B0D85947716A} = {06FC0E85-E73C-4DC1-B6FD-A583B7B1DFE4}
{631582D9-EEEA-4F9D-8069-71ECA24ED282} = {38C56AEB-DB08-4CBF-AAC0-EBFC2B0EE045}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {90E42483-9D9A-4800-B1FE-B5044432D28F}
EndGlobalSection
EndGlobal
46 changes: 24 additions & 22 deletions src/ReadLine.Demo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
using System;

namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("ReadLine Library Demo");
Console.WriteLine("---------------------");
Console.WriteLine();
namespace ReadLine.Demo {
public class Program {
public static void Main(string[] args) {
Console.WriteLine("ReadLine Library Demo");
Console.WriteLine("---------------------");
Console.WriteLine();

string[] history = new string[] { "ls -a", "dotnet run", "git init" };
ReadLine.AddHistory(history);
string[] history = {
"ls -a",
"dotnet run",
"git init"
};
ReadLine.AddHistory(history);

ReadLine.AutoCompletionHandler = (t, s) =>
{
if (t.StartsWith("git "))
return new string[] { "init", "clone", "pull", "push" };
else
return null;
};

string input = ReadLine.Read("(prompt)> ");
Console.Write(input);
ReadLine.AutoCompletionHandler = (t, s) => t.StartsWith("git ")
? new[] {
"init",
"clone",
"pull",
"push"
}
: null;

var input = ReadLine.Read("(prompt)> ");
Console.Write(input);
}
}
}
}
3 changes: 1 addition & 2 deletions src/ReadLine.Demo/ReadLine.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<DebugType>portable</DebugType>
<AssemblyName>ReadLine.Demo</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>ReadLine.Demo</PackageId>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ReadLine/Abstractions/IConsole.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace ReadLine.Abstractions {
internal interface IConsole {
public interface IConsole {
int CursorLeft { get; }
int CursorTop { get; }
int BufferWidth { get; }
Expand Down
2 changes: 1 addition & 1 deletion src/ReadLine/KeyHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ReadLine.Abstractions;

namespace ReadLine {
internal class KeyHandler {
public class KeyHandler {
private int _cursorPos;
private int _cursorLimit;
private readonly StringBuilder _text;
Expand Down
3 changes: 2 additions & 1 deletion src/ReadLine/ReadLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>A GNU-Readline like library for .NET/.NET Core</Description>
<AssemblyTitle>ReadLine</AssemblyTitle>
<VersionPrefix>1.2.0</VersionPrefix>
<Authors>Toni Solarin-Sodara</Authors>
<Authors>Toni Solarin-Sodara;Latency McLaughlin</Authors>
<TargetFrameworks>netcoreapp2.0;net47</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>ReadLine</AssemblyName>
Expand All @@ -22,6 +22,7 @@
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>snKey.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
Expand Down
89 changes: 41 additions & 48 deletions test/ReadLine.Tests/Abstractions/Console2.cs
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
using Internal.ReadLine.Abstractions;

namespace ReadLine.Tests.Abstractions
{
internal class Console2 : IConsole
{
public int CursorLeft => _cursorLeft;

public int CursorTop => _cursorTop;

public int BufferWidth => _bufferWidth;

public int BufferHeight => _bufferHeight;

private int _cursorLeft;
private int _cursorTop;
private int _bufferWidth;
private int _bufferHeight;

public Console2()
{
_cursorLeft = 0;
_cursorTop = 0;
_bufferWidth = 100;
_bufferHeight = 100;
}

public void SetBufferSize(int width, int height)
{
_bufferWidth = width;
_bufferHeight = height;
}

public void SetCursorPosition(int left, int top)
{
_cursorLeft = left;
_cursorTop = top;
}

public void Write(string value)
{
_cursorLeft += value.Length;
}

public void WriteLine(string value)
{
_cursorLeft += value.Length;
}
using ReadLine.Abstractions;

namespace ReadLine.Tests.Abstractions {
internal class Console2 : IConsole {
public int CursorLeft => _cursorLeft;

public int CursorTop => _cursorTop;

public int BufferWidth => _bufferWidth;

public int BufferHeight => _bufferHeight;

private int _cursorLeft;
private int _cursorTop;
private int _bufferWidth;
private int _bufferHeight;

public Console2() {
_cursorLeft = 0;
_cursorTop = 0;
_bufferWidth = 100;
_bufferHeight = 100;
}

public void SetBufferSize(int width, int height) {
_bufferWidth = width;
_bufferHeight = height;
}

public void SetCursorPosition(int left, int top) {
_cursorLeft = left;
_cursorTop = top;
}

public void Write(string value) {
_cursorLeft += value.Length;
}

public void WriteLine(string value) {
_cursorLeft += value.Length;
}
}
}
Loading

0 comments on commit b42ac5c

Please sign in to comment.