Skip to content

String comparing #31

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

Closed
TrySound opened this issue Nov 7, 2015 · 1 comment
Closed

String comparing #31

TrySound opened this issue Nov 7, 2015 · 1 comment

Comments

@TrySound
Copy link

TrySound commented Nov 7, 2015

Hi. I need to compare multiline strings but the output is too hard to analyze. It the a way to make it more visual. For example fast-diff seems interesting.

The second problem is compare on windows. When read input or output from disk it contains \r\n linebreaks. Every time I should to add .replace(/\r\n/g, '\n')

@twada
Copy link
Member

twada commented Nov 9, 2015

Hi @TrySound , thank you for your opinion. I understand.

power-assert is designed to be run under any environments, from old browsers to modern console, so I could not give universal fancy diffs yet (assuming only mono-color environment).

If you are using power-assert via AVA, you may be using modern console. If you only use AVA through console, customized renderer may help. I'm going to provide customized renderer for AVA users.

refs: Objects are difficult to differentiate. · Issue #1 · twada/power-assert-renderers

So, I'm sorry for inconvenience. I'll work on this soon.

FYI: if you compare two strings by ===, power-assert will show you Line level diffs by google-diff-match-patch. This feature might be help you (it's not a friendly enough though).

The second problem is compare on windows

Sorry, I have no idea to solve this. Some filtering/converting libraries may help.

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

No branches or pull requests

2 participants