Add different types of parsing
This commit is contained in:
@ -3,12 +3,12 @@ using System.Text;
|
||||
|
||||
{
|
||||
string testName = "Bool test";
|
||||
string testString1 = "column1:type:boolean\tcolumn2:binary\tcolumnthree\\nyep:string" +
|
||||
string testString1 = "column1:ty\\#pe:boolean\tcolumn2:binary\tcolumnthree\\nyep:string" +
|
||||
"\nTRUE\tvalue\\\\t\0woo\tvaluetrhee" +
|
||||
"\nFALSE\tnother\tno\\ther";
|
||||
|
||||
SaneTsv parsed = SaneTsv.Parse(Encoding.UTF8.GetBytes(testString1));
|
||||
if (parsed.Records[0]["column1:type"] is bool result && result)
|
||||
SaneTsv parsed = SaneTsv.ParseTypedTsv(Encoding.UTF8.GetBytes(testString1));
|
||||
if (parsed.Records[0]["column1:ty#pe"] is bool result && result)
|
||||
{
|
||||
Console.WriteLine($"Passed {testName}");
|
||||
}
|
||||
@ -26,7 +26,7 @@ using System.Text;
|
||||
"\nTUE\tvalue\\\\t\0woo\tvaluetrhee" +
|
||||
"\nFALSE\tnother\tno\\ther";
|
||||
|
||||
SaneTsv parsed = SaneTsv.Parse(Encoding.UTF8.GetBytes(testString1));
|
||||
SaneTsv parsed = SaneTsv.ParseTypedTsv(Encoding.UTF8.GetBytes(testString1));
|
||||
Console.WriteLine($"Failed {testName}");
|
||||
}
|
||||
catch (Exception)
|
||||
|
Reference in New Issue
Block a user