benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Stylus fails test

Open CyberAP opened this issue 6 years ago • 6 comments
trafficstars

Basically you can't run preprocessor tests since Stylus breaks it.

ParseError: benchmark\cache\bootstrap.css:1952:529
   1948|
   1949| .was-validated .custom-select:valid, .custom-select.is-valid {
   1950|   border-color: #28a745;
   1951|   padding-right: calc((1em + 0.75rem) * 3 / 4 + 1.75rem);
   1952|   background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
   1953| }
   1954|
   1955| .was-validated .custom-select:valid:focus, .custom-select.is-valid:focus {

expected ")", got ";"

    at Parser.error (benchmark\node_modules\stylus\lib\parser.js:259:11)
    at Parser.expect (benchmark\node_modules\stylus\lib\parser.js:287:12)
    at Parser.functionCall (benchmark\node_modules\stylus\lib\parser.js:1716:10)
    at Parser.primary (benchmark\node_modules\stylus\lib\parser.js:2178:18)
    at Parser.member (benchmark\node_modules\stylus\lib\parser.js:2070:21)
    at Parser.subscript (benchmark\node_modules\stylus\lib\parser.js:2048:21)
    at Parser.unary (benchmark\node_modules\stylus\lib\parser.js:2039:17)
    at Parser.defined (benchmark\node_modules\stylus\lib\parser.js:2011:21)
    at Parser.multiplicative (benchmark\node_modules\stylus\lib\parser.js:1985:21)
    at Parser.additive (benchmark\node_modules\stylus\lib\parser.js:1970:21)
[00:54:25] 'preprocessors' errored after 43 s
npm ERR! Test failed.  See above for more details.

CyberAP avatar Mar 23 '19 21:03 CyberAP

Sure. Please send PR (anyway I don't know Stylus to deal with it)

ai avatar Mar 24 '19 00:03 ai

We can surpass errors, so all tests pass anyway, what do you think?

https://github.com/postcss/benchmark/blob/038abb02d44753e5550bb29a6ae7282ce4f77976/preprocessors.js#L194-L197


        stylus.render(styl, { filename: example }, err => {
          if (err)  console.error('Failed to pass test', err)
          done.resolve()
        })

CyberAP avatar Mar 24 '19 20:03 CyberAP

We can surpass errors,

Error will make benchmark results not accurate

ai avatar Mar 24 '19 20:03 ai

Submitted issues to Stylus: https://github.com/stylus/stylus/issues/2457 And Less: https://github.com/less/less.js/issues/3380

CyberAP avatar Mar 24 '19 23:03 CyberAP

Or we can just cut this property from Bootstrap example before tunning benchmark

ai avatar Mar 24 '19 23:03 ai

I have fixed this for Less locally with a help from maintainers, now only need to get any feedback from Stylus. If there's none I guess cutting that line is the only viable option. I'll also add error checks for other preprocessors where possible.

CyberAP avatar Mar 27 '19 13:03 CyberAP

Can be closed

ai avatar Dec 13 '22 10:12 ai