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

“wrong sign in by argument” for identical input and ANSI formatting #135

Closed
flying-sheep opened this issue Apr 29, 2019 · 8 comments
Closed

Comments

@flying-sheep
Copy link

flying-sheep commented Apr 29, 2019

diffobj::diffChr(
    'A Time Series:\n[1] 1 2 3 4',
    'A Time Series:\n[1] 1 2 3 4',
    format = 'ansi256',
    ignore.white.space = FALSE,
    interactive = FALSE)
Error in seq.default(dots[[1L]][[1L]], dots[[2L]][[1L]], by = dots[[3L]][[1L]]) : 
  wrong sign in 'by' argument 
13. stop("wrong sign in 'by' argument") 
12. seq.default(dots[[1L]][[1L]], dots[[2L]][[1L]], by = dots[[3L]][[1L]]) 
11. (function (...) UseMethod("seq"))(dots[[1L]][[1L]], dots[[2L]][[1L]], by = dots[[3L]][[1L]]) 
10. mapply(FUN = f, ..., SIMPLIFY = FALSE) 
9.  Map(seq, c(1L, head(tar.ends, -1L) + 1L), tar.ends, by = 1L) 
8.  word_to_line_map(hunks.flat, tar.dat, cur.dat, tar.ends, cur.ends, 
    tar.ind, cur.ind) 
7.  diff_word2(tar.dat.sub, cur.dat.sub, tar.ind = tar.rh, cur.ind = cur.rh, 
    diff.mode = "wrap", warn = warn, etc = etc) 
6.  line_diff(target, current, html_ent_sub(tar.capt, etc@style), 
    html_ent_sub(cur.capt, etc@style), etc = etc) 
5.  capt_fun(target, current, etc = etc.proc, err = err, extra) 
4.  .local(target, current, ...) 
3.  diffobj::diffChr(object, expected, format = "ansi256", ignore.white.space = FALSE, 
    interactive = FALSE) 
2.  diffobj::diffChr(object, expected, format = "ansi256", ignore.white.space = FALSE, 
    interactive = FALSE) 
1.  expect_id_text(repr_text(as.ts(1:4)), "A Time Series:\n[1] 1 2 3 4") 
@brodieG
Copy link
Owner

brodieG commented Apr 29, 2019

Thanks for the report. I'll be looking at this in the near future (1-2 weeks). Newline seems to cause the problem, though obviously it shouldn't.

@brodieG brodieG added the bug label Apr 29, 2019
@brodieG brodieG added this to the 0.2.3 milestone Apr 29, 2019
@flying-sheep
Copy link
Author

Grand. For the time being i just switched to if (!identical(a, b)) { ... } which makes my tests run again.

Thank you for this package! It makes testthat so much nicer to use than the builtin output: https://github.com/IRkernel/repr/blob/master/tests/testthat/helpers.r

@brodieG
Copy link
Owner

brodieG commented Apr 30, 2019

Great, also, fyi, testthat is planning on adding pluggable comparisons at some point.

@flying-sheep
Copy link
Author

Yeah, probably as a reaction to (or inspired by) my issue there: r-lib/testthat#852

@brodieG
Copy link
Owner

brodieG commented May 6, 2019

I think this is mostly fixed, but I ran into some issues in a fairly gnarly part of the code and didn't get to finish it this weekend. Hopefully this will be done in the next week or so.

@brodieG
Copy link
Owner

brodieG commented May 13, 2019

Are you the maintainer for repr? I'm seeing some failures on revdep checks, but those failures seem to be also happening in the current CRAN version. I'm guessing they are not caused by diffobj, but diffobj is involved in the display of the failures, so I am not certain.

@brodieG
Copy link
Owner

brodieG commented May 13, 2019

I am not certain this is the reason, but I suspect the new pillar 1.4.0 release is breaking things with changes in behavior of type_sum. @flying-sheep

brodieG added a commit that referenced this issue May 13, 2019
Fix #135, Fix #134, Fix #136, Fix #133, Fix #132
see NEWS for details
@flying-sheep
Copy link
Author

flying-sheep commented May 14, 2019

yes! sorry that you had to investigate, I’m aware of this and just need to release a new version.

thank you also for fixing diffobj 😄

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

No branches or pull requests

2 participants