-
-
Notifications
You must be signed in to change notification settings - Fork 205
fix: scrub file paths in error/warning snapshots and fix spacing #2538
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
Changes from all commits
ca9ff03
71d9fcf
7937564
280ce43
642b44b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,21 +44,28 @@ expect_not_identical_graphs <- function(g1, g2, ...) { | |||||||||
| expect_false(identical_graphs(g1, g2, ...)) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| scrub_igraph_file_paths <- function(y) { | ||||||||||
| # Scrub file name and line number from error/warning messages | ||||||||||
| # Handles "Source: filename:linenumber" and "At path/to/file:line :" patterns | ||||||||||
| # The "At" pattern may have an optional space before the final colon | ||||||||||
| y <- gsub("Source: [^:]+:(\\d+|xx|<linenumber>)", "Source: <file>:<line>", y) | ||||||||||
| y <- gsub("At [^:]+:(\\d+|xx) ?:", "At <file>:<line>:", y) | ||||||||||
|
Comment on lines
+51
to
+52
|
||||||||||
| y <- gsub("Source: [^:]+:(\\d+|xx|<linenumber>)", "Source: <file>:<line>", y) | |
| y <- gsub("At [^:]+:(\\d+|xx) ?:", "At <file>:<line>:", y) | |
| y <- gsub("Source: .+:(\\d+|xx|<linenumber>)", "Source: <file>:<line>", y) | |
| y <- gsub("At .+:(\\d+|xx) ?:", "At <file>:<line>:", y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the assertion here and below fail? If it's a bug, add a FIXME to the test. If this can never occur in practice, change the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertions fail because passing
NULLto these HRG functions triggers an assertion failure in the C code (the R wrapper convertsNULLto an empty HRG structure, which the C code doesn't handle properly). This is a bug in the C code - it should validate the input and return a proper error message instead of an assertion failure. Added FIXME comments in 280ce43 to document this issue.