-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from nyctef/string-literal-multi-crlf
allow windows (crlf) newlines in IsSafeStringLiteralMulti
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Alexandre Mutel. All rights reserved. | ||
// Licensed under the BSD-Clause 2 license. | ||
// See license.txt file in the project root for full license information. | ||
|
||
using NUnit.Framework; | ||
using Tomlyn.Model; | ||
|
||
namespace Tomlyn.Tests | ||
{ | ||
public class SerializationTests | ||
{ | ||
[Test] | ||
public void TestCrlfInMultilineString() | ||
{ | ||
var model = new TomlTable | ||
{ | ||
PropertiesMetadata = new TomlPropertiesMetadata() | ||
}; | ||
model.PropertiesMetadata.SetProperty("property", new TomlPropertyMetadata | ||
{ | ||
DisplayKind = TomlPropertyDisplayKind.StringLiteralMulti | ||
}); | ||
|
||
model["property"] = "string\r\nwith\r\nnewlines"; | ||
|
||
Assert.AreEqual("property = '''string\r\nwith\r\nnewlines'''\r\n", Toml.FromModel(model)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters