hadashiA/VYaml

Test error about \r\n and \n

Closed this issue · 2 comments

 Serialize_dynamic
   源: PrimitiveObjectFormatterTest.cs 行 13
   持续时间: 31 毫秒

  消息: 
  Expected string length 495 but was 468. Strings differ at index 14.
  Expected: "invoice: 34843\r\ndate: 2001-01-23T00:00:00.0000000\r\nbill-to: \r..."
  But was:  "invoice: 34843\ndate: 2001-01-23T00:00:00.0000000\nbill-to: \n  ..."
  --------------------------^


  堆栈跟踪: 
PrimitiveObjectFormatterTest.Serialize_dynamic() 行 57

I know it is not a code error, it just because when I clone from github, the end-of-line newlines are automatically converted to \r\n. So maybe you can update the check string. So maybe you can avoid this exception by changing the @ string to show the format that expresses the newline character \n.

Such as Assert.That(result, Is.EqualTo( "invoice: 34843\ndate: 2001-01-23T00:00:00.0000000\nbill-to: \n given: Chris\n family: Dumars\n address: \n lines: |\n 458 Walkman Dr.\n Suite #292\n city: Royal Oak\n state: MI\n postal: 48046\nproduct: \n- sku: BL394D\n quantity: 4\n description: Basketball\n price: 450\n- sku: BL4438H\n quantity: 1\n description: Super Hoop\n price: 2392\ntax: 251.42\ntotal: 4443.52\ncomments: |-\n Late afternoon is best.\n Backup contact is Nancy\n Billsmer @ 338-4338.\n"));

when I clone from github, the end-of-line newlines are automatically converted to \r\n.

This project is unified with the LF newlines.
Please check your git settings and clone it so that the newline code is not modified at your end.