Skip to content

Commit c33ecef

Browse files
committed
Added JSON escape test
1 parent 8bde723 commit c33ecef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/MoonSharp.Interpreter.Tests/EndToEnd/JsonSerializationTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ public void JsonObjectSerialization()
137137
AssertTableValues(t);
138138
}
139139

140+
[Test]
141+
public void JsonEscapeSequences()
142+
{
143+
string json = "{ \"anEscapedString\": \"\\a\\r\\n\\b\\f\\n\\r\\t\\v\\\\\\\"\\'\\[\\]\\/\" }";
144+
Table table = JsonTableConverter.JsonToTable(json);
145+
Assert.AreEqual(table.Get("anEscapedString").String, "\a\n\b\f\n\r\t\v\\\"\'[]/");
146+
}
140147

141148
}
142149
}

0 commit comments

Comments
 (0)