When serializing a TomlArray with TomlString elements, the TomlStrings are serialized without quotation marks. The output is invalid, causing a TomlParseException when attempting to deserialize the TOML.
Expected Result: array = [ "hello world" ]
Actual Result: array = [ hello world, ]
[TestMethod]
public void TestArrayConstruct()
{
TomlArray tomlArray = new TomlArray();
tomlArray.Add(new TomlString()
{
Value = "hello world"
});
string expectedResult = @"array = [ ""hello world"" ]";
var table = new TomlTable
{
["array"] = tomlArray
};
StringBuilder sb = new StringBuilder();
using (var sw = new StringWriter(sb))
{
table.ToTomlString(sw);
}
string actualResult = sb.ToString();
Assert.AreEqual(expectedResult, actualResult);
}
Hey! I've got another one.
When serializing a TomlArray with TomlString elements, the TomlStrings are serialized without quotation marks. The output is invalid, causing a TomlParseException when attempting to deserialize the TOML.
Expected Result:
array = [ "hello world" ]
Actual Result:
array = [ hello world, ]