GithubHelp home page GithubHelp logo

Comments (4)

tailhook avatar tailhook commented on August 11, 2024 1

No I'm not working on it.

You don't need \n unescaped linebreak works fine. (if you past your example into a Rust without editing you'll get two linebreaks, which is inconvenient)

from assert_cmd.

epage avatar epage commented on August 11, 2024

I'm in favor of

Format as binary, but line-by line. So weird characters are visible as escapes, but multi-line text output is readable

from assert_cmd.

smoelius avatar smoelius commented on August 11, 2024

Format as binary, but line-by line. So weird characters are visible as escapes, but multi-line text output is readable

Is the idea that a linebreak would be added after each \n?

E.g., something like this:

stderr=```<9910 bytes total>"    Blocking waiting for file lock on package cache\n    Checking libc v0.2.138\n    Checking cfg-if v1.0.0\n ....

Would instead look like this?

stderr=```<9910 bytes total>"    Blocking waiting for file lock on package cache\n
    Checking libc v0.2.138\n
    Checking cfg-if v1.0.0\n
....

@tailhook Are you working on this, by chance?

from assert_cmd.

smoelius avatar smoelius commented on August 11, 2024

I have a prototype working, but admittedly the boundaries between stdout, stderr, etc. become hard to find when the number of lines is large.

I can see at least six options.

  1. Do nothing and live with the current "ugly" output.
  2. Break lines unconditionally and live with the boundaries being hard to find.
  3. Indent. However, like @tailhook aluded to above, this would cause a disparity between the actual text and the text displayed.
  4. Add a method to Assert to enable this option. However, this could make for a confusing API. E.g., something like the following could cause a user to think with_linebreaks affects the predicate in stdout:
    Command::new(...)
        .assert()
        .with_linebreaks()
        .stdout(...);
  5. Enable this functionality with a feature.
  6. Choose a reasonable limit (similar to MIN_OVERFLOW, etc.) and show only a subset of the lines when the total number of lines would exceed that limit.

Thoughts?

from assert_cmd.

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.