Giter Site home page Giter Site logo

Add tests for CLI about asciigraph HOT 2 OPEN

guptarohit avatar guptarohit commented on July 23, 2024
Add tests for CLI

from asciigraph.

Comments (2)

guptarohit avatar guptarohit commented on July 23, 2024 1

This would be tricky, possibly we have to redirect stdin & stdout. Redirect os.stdout to some in-memory buffer or temp file maybe? And similarly, pass out input test data to os.stdin.
Unfortunately atm I don't have any related resource for it, but if I find anything related to it I'll share here.
Yes, testing flags as well would be good idea.

from asciigraph.

KarlHeitmann avatar KarlHeitmann commented on July 23, 2024

Do you have any idea on how to make the tests for CLI? I am quite new to go, I've done some testing on Rust, and I took a look at asciigraph_test.go file and understand how it works. But how can I test the for s.Scan() { ... } block on line 104? Do you have any resource or example I can take as source of inspiration? Would you like to test the flags passed to CLI are doing the right thing?

from asciigraph.

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.