diff --git a/YamlDotNet.Test/Serialization/SerializationTests.cs b/YamlDotNet.Test/Serialization/SerializationTests.cs index b9a771110..3c511e9f0 100644 --- a/YamlDotNet.Test/Serialization/SerializationTests.cs +++ b/YamlDotNet.Test/Serialization/SerializationTests.cs @@ -1020,10 +1020,10 @@ public void SpecialFloatsAreDeserializedCorrectly() [Fact] public void SpecialFloatsAreSerializedCorrectly() { - var deserializer = new Serializer(); + var serializer = new Serializer(); var buffer = new StringWriter(); - deserializer.Serialize(buffer, new double[] + serializer.Serialize(buffer, new double[] { double.NaN, double.PositiveInfinity, @@ -1037,6 +1037,17 @@ public void SpecialFloatsAreSerializedCorrectly() Assert.Contains("- -.inf", text); } + [Fact] + public void NegativeIntegersCanBeDeserialized() + { + var deserializer = new Deserializer(); + + var value = deserializer.Deserialize(Yaml.ReaderForText(@" + '-123' + ")); + Assert.Equal(-123, value); + } + #region Test Dictionary that implements IDictionary<,>, but not IDictionary public class GenericTestDictionary : IDictionary {