Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests containing escaped new lines (\n) fail on Windows #7682

Closed
CronKz opened this issue Nov 4, 2024 · 0 comments · Fixed by #7683
Closed

Tests containing escaped new lines (\n) fail on Windows #7682

CronKz opened this issue Nov 4, 2024 · 0 comments · Fixed by #7683

Comments

@CronKz
Copy link
Contributor

CronKz commented Nov 4, 2024

Product

Hot Chocolate

Version

14.0.0

Link to minimal reproduction

See below

Steps to reproduce

  1. Use a Windows machine
  2. Run any Integration Test containing escaped new lines \n
  • Example: HotChocolate.Data.EntitiyFramework.Pagination.Tests
  • Paging_With_PagingFlags_Override

What is expected?

The tests should succeed

What is actually happening?

The tests fail when comparing the diff. Windows uses \r\n instead of \n.

Xunit.Sdk.XunitException
The snapshot does not match:

Paging_With_PagingFlags_Override

{
  "data": {
    "products": {
      "pageCount": 10
    }
  },
  "extensions": {
-     "sql": "-- @__p_0='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @__p_0"
+     "sql": "-- @__p_0='11'\r\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\r\nFROM \"Products\" AS p\r\nORDER BY p.\"Id\"\r\nLIMIT @__p_0"
  }
}

Relevant log output

No response

Additional context

I'll submit a possible fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants