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

Fixed bug with css pseudo-classes #431

Closed
wants to merge 1 commit into from

Conversation

akalongman
Copy link

Fixed bug when formatter adds whitespace after colon in a:hover or other pseudo-classes

Fixed bug when formatter adds whitespace after colon in a:hover or other pseudo-classes
@evocateur
Copy link
Contributor

Could you add some test cases to verify this fix, please? Also, does the issue repro in the JS version?

@akalongman
Copy link
Author

How can I add tests?

@evocateur
Copy link
Contributor

Add expected input and output assertions to beautify-tests.js and testjsbeautifier.py.

After an initial npm install ., execute make test to run the tests for both languages. In most cases, you should be able to copy & paste tests between the Python and JS versions.

@pixelastic
Copy link

I'm also interested in this fix. I tried to add some tests to this pull request but couldn't get make test to pass, even on a clean pull of the original repo.

Here is the output of make test for commit c30247f on branch master:

Testing javascript implementation...
v0.10.21

> [email protected] test /home/tca/local/etc/js-beautify-einars
> ./js/test/shell-smoke-test.sh && node ./js/test/node-beautify-tests.js

----------------------------------------
Testing common cli behavior...
Script: /home/tca/local/etc/js-beautify-einars/js/test/../bin/css-beautify.js
----------------------------------------
Testing common cli behavior...
Script: /home/tca/local/etc/js-beautify-einars/js/test/../bin/html-beautify.js
----------------------------------------
Testing common cli behavior...
Script: /home/tca/local/etc/js-beautify-einars/js/test/../bin/js-beautify.js
----------------------------------------
Testing js-beautify cli behavior...
beautified ../../../../../tmp/js-beautify-mkdir/js-beautify.js
Files /home/tca/local/etc/js-beautify-einars/js/test/../bin/css-beautify.js and - differ
beautified ../../../../../tmp/js-beautify-mkdir/example1-default.js
Files /tmp/js-beautify-mkdir/example1-default.js and - differ
Files /tmp/js-beautify-mkdir/example1-default.js and - differ
js-beautify output for /tmp/js-beautify-mkdir/example1-default.js was expected to be different based on HOME settings.
npm ERR! weird error 1
npm ERR! not ok code 0
make: *** [testj] Error 1

If I could get this to pass, I could try to add the missing tests for the PR.

@bitwiseman
Copy link
Member

That is strange. c30247f passed in travis-ci. Not sure what could be the problem...

@pixelastic
Copy link

I'm running ubuntu 13.10 on a 64bit system, using node v0.10.21.

Steps to reproduce are:

git clone [email protected]:einars/js-beautify.git ./js-beautify
cd ./js-beautify
git checkout c30247fa005b9a5227a6b69ae18efc4460787d98
npm install
make test

Let me know if you need any more information, I'll be glad to help.

@noducks
Copy link

noducks commented May 28, 2014

In the tests referenced above, ::selection selector fails and ends up as : : selection

@bitwiseman
Copy link
Member

Thing have moved forward quite a bit since this was written. Closing. Please merge and reopen if you see the need.

@bitwiseman bitwiseman closed this Sep 30, 2014
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.

5 participants