'Sane' -> 'Simple' for first format
Change the naming so the overall family of formats is Sane TSV, while the simplest format is Simple TSV.
This commit is contained in:
@ -39,7 +39,7 @@ using System.Text;
|
||||
{
|
||||
string testName = "Comment test";
|
||||
string testString1 = "#This is a file comment\n" +
|
||||
" #One more file comment line\n" +
|
||||
"#One more file comment line\n" +
|
||||
"column1:type:boolean\tcolumn2:binary\tcolumnthree\\nyep:string" +
|
||||
"\n#This is a comment" +
|
||||
"\n#Another comment line" +
|
||||
@ -49,4 +49,23 @@ using System.Text;
|
||||
SaneTsv parsed = SaneTsv.ParseCommentedTsv(Encoding.UTF8.GetBytes(testString1));
|
||||
}
|
||||
|
||||
{
|
||||
string testName = "Serde test";
|
||||
string testString1 = "column1\tcolumn2\tcolumnthree\\nyep" +
|
||||
"\nTRUE\tvalue\\\\twoo\tvaluetrhee" +
|
||||
"\nFALSE\tnother\tno\\ther";
|
||||
|
||||
SaneTsv parsed = SaneTsv.ParseSimpleTsv(Encoding.UTF8.GetBytes(testString1));
|
||||
string serialized = Encoding.UTF8.GetString(SaneTsv.SerializeSimpleTsv(parsed.ColumnNames, parsed.Records.Select(r => r.Fields.Select(f => f.ToString()).ToArray()).ToArray()));
|
||||
|
||||
if (testString1 == serialized)
|
||||
{
|
||||
Console.WriteLine($"Passed {testName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Failed {testName}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Done with tests");
|
||||
|
Reference in New Issue
Block a user