2020-03-26 04:25:48 +00:00
|
|
|
|
using Xunit;
|
2020-01-06 22:00:22 +00:00
|
|
|
|
|
2020-03-26 04:25:48 +00:00
|
|
|
|
namespace Wabbajack.Common.Test
|
2020-01-06 22:00:22 +00:00
|
|
|
|
{
|
|
|
|
|
public class IniTests
|
|
|
|
|
{
|
|
|
|
|
|
2020-03-26 04:25:48 +00:00
|
|
|
|
[Fact]
|
2020-01-06 22:00:22 +00:00
|
|
|
|
public void TestByteArrayParsing()
|
|
|
|
|
{
|
2020-03-26 04:25:48 +00:00
|
|
|
|
Assert.Equal("bar", @"[General]
|
2020-01-06 22:00:22 +00:00
|
|
|
|
foo = bar".LoadIniString().General.foo);
|
|
|
|
|
|
2020-03-26 04:25:48 +00:00
|
|
|
|
Assert.Equal("baz\\bar", @"[General]
|
2020-01-06 22:00:22 +00:00
|
|
|
|
foo = baz\\bar".LoadIniString().General.foo);
|
|
|
|
|
|
2020-03-26 04:25:48 +00:00
|
|
|
|
Assert.Equal("bar", @"[General]
|
2020-01-06 22:00:22 +00:00
|
|
|
|
foo = @ByteArray(bar)".LoadIniString().General.foo);
|
|
|
|
|
|
2020-03-26 04:25:48 +00:00
|
|
|
|
Assert.Equal("foo\\h̴̹͚̎é̶̘͙̐l̶͕̔͑p̴̯̋͂m̶̞̮͘͠e̸͉͙͆̄\\baz", @"[General]
|
2020-01-06 22:00:22 +00:00
|
|
|
|
foo = @ByteArray(foo\\\x68\xcc\xb4\xcc\x8e\xcc\xb9\xcd\x9a\x65\xcc\xb6\xcd\x81\xcc\x90\xcc\x98\xcd\x99\x6c\xcc\xb6\xcc\x94\xcd\x91\xcd\x95\x70\xcc\xb4\xcc\x8b\xcd\x82\xcc\xaf\x6d\xcc\xb6\xcd\x98\xcd\xa0\xcc\x9e\xcc\xae\x65\xcc\xb8\xcd\x86\xcc\x84\xcd\x89\xcd\x99\\baz)".LoadIniString().General.foo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|