-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
FWIW hh-clilib doesn't currently provide a color abstraction as I'm waiting for XHP namespaces first |
- trace contains fully-qualified names. Namespaced functions may be autoimported, or explicitly used - `invariant()` shows up in backtrace as `invariant_violation` - if we don't find it at all, report the whole line
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.
- do we want the full stack trace in non-verbose mode? maybe just the last part (prettyprinted relevant line from the test file) would be enough
- not specific to this PR but eventually it would be nice to have some way to write regression tests for these -- maybe adding a
.expect
file for everything intests/dirty
? then it shouldn't be too hard to write a test that runs a dirty test and compares the output, and we could add new dirty test cases for all these output fixes/improvements...
$fun_offset is null && $frame['function'] === "HH\\invariant_violation" | ||
) { | ||
$fun = 'invariant'; | ||
$fun_offset = Str\search($blame_line, 'invariant('); |
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.
could also be invariant_violation
, or does that one not exist in open-source?
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.
If it's a direct call to invariant_violation()
it will match a previous Str\search and $fun_offset
will not be null
The changes on 2.0 should allow doing this better: can either directly observe events, or create an instance of the CLI class with fake stdin/out and assert them. I'd like to get rid of tests/dirty entirely - but that probalby needs a little more refactoring so we can just do "run these test lambdas" rather than 'run whatever's in these files/directories' |
Concise first, then verbose:
refs #18