-
Notifications
You must be signed in to change notification settings - Fork 0
74 - Add diff renderer and improve reporting #113
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
Conversation
|
If @Vurv78 doesn't pick this up later today then I'll probably start a review |
yogwoggf
left a comment
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.
LGTM 👍
| local function isLuaSymbol(value) | ||
| return type(value) == "string" | ||
| and not KEYWORDS[value] | ||
| and not not string.match(value, "^[_%a][_%a%d]*$") |
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.
Just to confirm, this is a boolean coercion right? Looks sort of strange
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.
Yep, to avoid returning a non-boolean here
Issue
Resolves #74
Changes
prettyValueintoserialiseValue, which recursively prints tables that do not have an overriddentostringrenderDifffunction which is used to generate a diff between any two values, optionally performing a "deep" recursive diffprettyValueto useserialiseValuerequirepaths to remove the need forsrc.lua.in everyrequire()renderDiff)expectprint to not serialise the values intoexpect(...).matcherName(...)to avoid duplicating informationImpact
src.luamanually, and automatically importingindex.luafiles when a directory path is givenTesting
Fairly well covered by automated tests, but should try the following:
toBefailure messages display serialised expected and received with no table diff renderingtoEqualfailure messages matchtoBeif one or both values are not a tabletoEqualfailure messages for two tables{1, 2, 3}), symbol key ({foo = "bar"}) or expression key ({["end"] = "bar"})never.toBeandnever.toEqualfailure messages always show the serialised expected value in the formatExpected: not %sHelpful Links
API Docs
Project Board
Discord