Many editors either automatically remove trailing whitespace or have extensions that do so. Unfortunately, when trailing whitespace is removed from (say) Serialization/SerializationTests.cs, multiple tests fail with e.g.,
[xUnit.net 00:00:03.99] ExampleFromSpecificationIsHandledCorrectly [FAIL]
Failed ExampleFromSpecificationIsHandledCorrectly [1 ms]
Error Message:
System.ArgumentOutOfRangeException : startIndex cannot be larger than length of string. (Parameter 'startIndex')
Stack Trace:
at System.String.Substring(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex)
at YamlDotNet.Test.Yaml.<>c__DisplayClass10_0.<Text>b__2(String l) in C:\dd\dnx\other\YamlDotNet\YamlDotNet.Test\Yaml.cs:line 111
at System.Linq.Enumerable.SelectListIterator`2.ToList()
at YamlDotNet.Test.Yaml.Text(String yamlText) in C:\dd\dnx\other\YamlDotNet\YamlDotNet.Test\Yaml.cs:line 110
at YamlDotNet.Test.Serialization.SerializationTests.ExampleFromSpecificationIsHandledCorrectly() in C:\dd\dnx\other\YamlDotNet\YamlDotNet.Test\Serialization\SerializationTests.cs:line 1230
That particular test fails at the empty line near the top of the yamlText:
obj:
- &CENTER { x: 1, y: 2 }
- &LEFT { x: 0, y: 2 }
- &BIG { r: 10 }
- &SMALL { r: 1 }
# All the following maps are equal:
Fix is fairly simple. I'll put up a PR in a bit…
To Reproduce
Edit Serialization/SerializationTests.cs and remove all trailing whitespace, at least in the ExampleFromSpecificationIsHandledCorrectly() fact. Then, execute that test.
Describe the bug
Many editors either automatically remove trailing whitespace or have extensions that do so. Unfortunately, when trailing whitespace is removed from (say) Serialization/SerializationTests.cs, multiple tests fail with e.g.,
That particular test fails at the empty line near the top of the
yamlText
:Fix is fairly simple. I'll put up a PR in a bit…
To Reproduce
Edit Serialization/SerializationTests.cs and remove all trailing whitespace, at least in the
ExampleFromSpecificationIsHandledCorrectly()
fact. Then, execute that test.