You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test() failure not helpful for reporting exact match subset #7834
test(1, c(1:10, 11:1000), c(1:10, 1000:11))
# Test 1 ran without errors but failed check that x equals y:# > x = c(1:10, 11:1000) # First 6 of 1000 (type 'integer'): # [1] 1 2 3 4 5 6# > y = c(1:10, 1000:11) # First 6 of 1000 (type 'integer'): # [1] 1 2 3 4 5 6# Mean relative difference: 0.9792285
We don't get any indication of how x and y actually differ because the glimpse only shows us the first 6 entries no matter what.
For double/complex, the way to proceed is tough, because "how different is different" is very tough in general.
Still, I think we can do better than completely ignoring the issue.
test(1, NA_character_, 'abc')
# Test 1 ran without errors but failed check that x equals y:# > x = NA_character_ # First 1 different of 1 (1 total, type 'character'): # x[1] # NA # Non-ASCII string detected, raw representation:# $`x[1]`# [1] 4e 41# > y = "abc" # First 1 different of 1 (1 total, type 'character'): # y[1] # "abc" # 'is.NA' value mismatch: 0 in current 1 in target
Activity
MichaelChirico commentedon Jul 24, 2026
Similar issue addressed by #7836: