Giter Site home page Giter Site logo

Comments (11)

xcthulhu avatar xcthulhu commented on August 16, 2024

Looks like the newlines aren't escaped anymore... is that the only problem?

from codewars-runner-cli.

jhoffner avatar jhoffner commented on August 16, 2024

Mine are all passing when running node test. Try pulling latest and re-running. Maybe you are out of sync?

Also yes newlines are no longer escaped but instead replaced with the <:LF:> token. We ran into issues with escape levels and we found it easier to do it this way then to update the entire code stack to handle multiple levels of escaping via "JSON.stringify". We still need to update the Julia/Haskel/Clojure implementations to support <:LF:>

from codewars-runner-cli.

xcthulhu avatar xcthulhu commented on August 16, 2024

So for <:LF:>, is this for user output, or test-framework output, or both?

from codewars-runner-cli.

jhoffner avatar jhoffner commented on August 16, 2024

test-framework output. Basically, each stdout line within the runner output is considered a new data item. However if a single data item is supposed to have multiple lines within it, then things get messed up.
So in the following example, we actually want there to be two "data items" but since the passed message includes a \n, its not possible to for the HTML formatter to know.

<PASSED::>Good\nJob
<FAILED::>Some error

So we change it to

<PASSED::>Good<:LF:>Job
<FAILED::>Some error

from codewars-runner-cli.

xcthulhu avatar xcthulhu commented on August 16, 2024

Changing the test frameworks to support this is hard. I don’t know if this is possible in Julia.

Can this be done in the exec function in util.js?

On Jul 15, 2014, at 5:59 PM, Jake Hoffner [email protected] wrote:

test-framework output. Basically, each stdout line within the runner output is considered a new data item. However if a single data item is supposed to have multiple lines within it, then things get messed up.
So in the following example, we actually want there to be two "data items" but since the passed message includes a \n, its not possible to for the HTML formatter to know.

PASSED::Good\nJob
FAILED::Some error
So we change it to

PASSED::Good<:LF:>Job
FAILED::Some error

Reply to this email directly or view it on GitHub.

from codewars-runner-cli.

jhoffner avatar jhoffner commented on August 16, 2024

If we are able to format the <IT::>, <PASSED::> stuff then this should be able to be done in the same place. For example in Julia you could do it within the format_assertion method. Checkout the JS and Ruby version for how this is done in those.

It couldn't be done in util.js because at that point, the data is already written to stdout and we have no way of knowing if \n is meant to be escaped or not.

from codewars-runner-cli.

xcthulhu avatar xcthulhu commented on August 16, 2024

Ok… well in that case there’s nothing to be done for Clojure or Julia, as I believe I don’t actually emit newlines in either one of those test-frameworks. I’ll double check.

This is pretty hard to do for Haskell, however...

On Jul 15, 2014, at 6:37 PM, Jake Hoffner [email protected] wrote:

If we are able to format the IT::, PASSED:: stuff then this should be able to be done in the same place. For example in Julia you could do it within the format_assertion method. Checkout the JS and Ruby version for how this is done in those.

It couldn't be done in util.js because at that point, the data is already written to stdout and we have no way of knowing if \n is meant to be escaped or not.


Reply to this email directly or view it on GitHub.

from codewars-runner-cli.

jhoffner avatar jhoffner commented on August 16, 2024

We need new lines though.

For example:

<PASSED::>Passed<PASSED::>Passed

would end up being shown to users as a single passed statement saying Passed<PASSED::>Passed.

from codewars-runner-cli.

jhoffner avatar jhoffner commented on August 16, 2024

Looks like Haskell should be possible. The Formatters.hs just needs to have its exampleSucceeded, exampleFailed and formatFailure methods tweaked.

from codewars-runner-cli.

xcthulhu avatar xcthulhu commented on August 16, 2024

Well, hspec wraps a lot of other utilities that have newlines in their output, so I was worried about that.

from codewars-runner-cli.

xcthulhu avatar xcthulhu commented on August 16, 2024

This appears to have been largely closed by d051ae9 and 04e3c66 (along with other commits)

from codewars-runner-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.