mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: First attempt at an ANSI to HTML converter
This commit is contained in:
committed by
Chris Cameron
parent
fde3106389
commit
c453717998
22
ICD.Common.Utils.Tests/Converters/AnsiToHtmlTest.cs
Normal file
22
ICD.Common.Utils.Tests/Converters/AnsiToHtmlTest.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using ICD.Common.Utils.Converters;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace ICD.Common.Utils.Tests.Converters
|
||||
{
|
||||
[TestFixture]
|
||||
public sealed class AnsiToHtmlTest
|
||||
{
|
||||
[TestCase("black\x1b[37mwhite",
|
||||
@"black<span style=""color:#BBBBBB"">white</span>")]
|
||||
[TestCase("black\x1b[0mblack",
|
||||
@"blackblack")]
|
||||
[TestCase("black\x1b[37mwhite\x1b[0m",
|
||||
@"black<span style=""color:#BBBBBB"">white</span>")]
|
||||
[TestCase("\x1b[30mblack\x1b[37mwhite",
|
||||
@"<span style=""color:#000000"">black<span style=""color:#BBBBBB"">white</span></span>")]
|
||||
public void ConvertTest(string ansi, string expected)
|
||||
{
|
||||
Assert.AreEqual(expected, AnsiToHtml.Convert(ansi));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user