Fix file comment serialization
This commit is contained in:
@ -759,6 +759,30 @@ internal class Program : SaneTsv
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
string testName = "File comment serde";
|
||||
|
||||
string testString1 = "#this is a file comment" +
|
||||
"\n# and one more line since you're such a good customer" +
|
||||
"\ncolumn1:type:boolean\tcolumn2:binary\tcolumnthree\\nyep:string" +
|
||||
"\nTRUE\tvalue\\\\t\0woo\tvaluetrhee" +
|
||||
"\nFALSE\tnother\tno\\ther";
|
||||
|
||||
|
||||
CommentedTsv<BoolTestRecord2> parsed = SaneTsv.ParseCommentedTsv<BoolTestRecord2>(Encoding.UTF8.GetBytes(testString1));
|
||||
|
||||
string reserialized = Encoding.UTF8.GetString(SaneTsv.SerializeCommentedTsv<BoolTestRecord2>(parsed.Records, parsed.FileComment));
|
||||
|
||||
if (reserialized == testString1)
|
||||
{
|
||||
Console.WriteLine($"Passed {testName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Failed {testName}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Done with tests");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user