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

allow customizable RenderMode for txt #19

Merged
merged 1 commit into from
Nov 3, 2018
Merged

allow customizable RenderMode for txt #19

merged 1 commit into from
Nov 3, 2018

Conversation

Evizero
Copy link
Member

@Evizero Evizero commented Oct 31, 2018

This commit enables a user to provide a mode keyword to @test_reference for "txt" files, which overwrites the default RenderMode. This is useful if the text contains ANSII colors and should not be displayed as a Diff, but rather as a BeforeAfter.

This will allow convenient testing for UnicodePlots ... thats right, its finally happening.

@oxinabox
Copy link
Member

Seems sensible.
Shall we export the Mode types?
(Or maybe put them in there own module and export that?)

@Evizero
Copy link
Member Author

Evizero commented Oct 31, 2018

Or maybe put them in there own module and export that?

that could be nice. another thing to consider is to call the paramter render instead of mode.
render = Diff() maybe makes more intuitive sense.

@oxinabox
Copy link
Member

oxinabox commented Nov 1, 2018

Good idea

This commit enables a user to provide a `render` keyword
to `@test_reference` for "txt" files, which overwrites
the default `RenderMode`.

This is useful if the text contains ANSII colors and
should not be displayed as a `Diff`, but rather as
a `BeforeAfter` (e.g. for testing UnicodePlots).
@@ -7,7 +7,7 @@ if isinteractive()
@info ("In interactive use, one should respond \"n\" when the program"
* " offers to create or replace files associated with some tests.")
else
@info ("Four tests should correctly report failure in the transcript"
@info ("Eight tests should correctly report failure in the transcript"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did you count to get to "four" ? if I count all the "complaints" about failing test or non-existing files i got to "seven" before the additional one in this PR. (thought its quite hard to count because the visual separation isn't too great)

@Evizero
Copy link
Member Author

Evizero commented Nov 1, 2018

I changed the keyword to render. Concerning the types. lets just leave them unexported for now until we had some time to make use of this. As long as its not exported we remain free to break things

@Evizero Evizero merged commit be61998 into master Nov 3, 2018
@Evizero Evizero deleted the cs/ansiitext branch November 3, 2018 12:35
@oxinabox
Copy link
Member

oxinabox commented Nov 9, 2018

As an aside thinking about this.
I am quiet pleased the re-architecturing of system before made this change not difficult

@Evizero
Copy link
Member Author

Evizero commented Nov 9, 2018

absolutely

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

Successfully merging this pull request may close these issues.

None yet

2 participants