Skip to content

Fix tests for complex - #5796

Merged
MichaelChirico merged 2 commits into
masterfrom
complex-na
Dec 6, 2023
Merged

MichaelChirico merged 2 commits into
masterfrom
complex-na

Conversation

@MichaelChirico

Copy link
Copy Markdown
Member

Part of #5748 (fixed for master, not hotfix)

Comment thread inst/tests/tests.Rraw

test(1743.22, fread("a,b,c\n1999/01/01,2,f", colClasses=list(Date=1L), drop="a"), data.table(b=2L, c="f"))
test(1743.231, fread("a,b,c\n2,1,4i", colClasses=list(complex="c", integer=2L), drop="a"), data.table(b=1L, c="4i"),
test(1743.231, fread("a,b,c\n2,1,4j", colClasses=list(complex="c", integer=2L), drop="a"), data.table(b=1L, c="4j"),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a substantial improvement in r-devel -- previously it seems as.complex("4i") would fail to coerce which seems wrong. Better to try and coerce to complex something that's not actually complex, to ensure the warning continues.

cc original author @HughParsonage in case I'm missing something behind the intent of this test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Matt added that specific test, though I added the tests around it, which looks to have been a back and forth that observed but did not mention the behaviour of as.complex("4i"):

c6e2b72#diff-e3243f3780ce7d303c3317f73945310bfc37e45d193568246246aca20e3270ae

@codecov

codecov Bot commented Dec 6, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9f868d1) 97.46% compared to head (9e2067e) 97.46%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5796   +/-   ##
=======================================
  Coverage   97.46%   97.46%           
=======================================
  Files          80       80           
  Lines       14814    14814           
=======================================
  Hits        14439    14439           
  Misses        375      375           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichaelChirico
MichaelChirico merged commit d8f7a30 into master Dec 6, 2023
@MichaelChirico
MichaelChirico deleted the complex-na branch December 6, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants