Giter Club home page Giter Club logo

digital-garden's Introduction

Rust Adventure

Running an exercise

There are two kinds of exercise. One is a binary and the other is a library.

The binary exercises can be run with cargo

cargo run --bin hello-world

Running Tests

Both kinds of exercises come with tests. You can run the tests for a specific exercise using cargo.

cargo test -p hello-world

Some exercises have more than one test. Giving the prefix of a test you want to run will scope down the tests to the ones that match that prefix.

cargo test -p hello-world output
sample output
    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running /Users/chris/github/christopherbiscardi/rust-adventure/target/debug/deps/hello_world-5edb99e9dd6fe5cd

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running /Users/chris/github/christopherbiscardi/rust-adventure/target/debug/deps/output-1191747d69332647

running 1 test
test hello_world_output ... FAILED

failures:

---- hello_world_output stdout ----
thread 'hello_world_output' panicked at 'Unexpected stdout, failed var - original <= 0
├── original: Hello, World!
├── actual distance: 2
├── diff: Hello, World!
Welcome to Rust!

└── var as str: Welcome to Rust!

command=`"/Users/chris/github/christopherbiscardi/rust-adventure/target/debug/hello-world"`
code=0
stdout=```Welcome to Rust!```
stderr=``````
', /Users/chris/.cargo/registry/src/github.com-1ecc6299db9ec823/assert_cmd-1.0.1/src/assert.rs:342:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    hello_world_output

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '-p hello-world --test output'
cargo test -p hello-world nonexisting
    Finished test [unoptimized + debuginfo] target(s) in 0.09s
     Running /Users/chris/github/christopherbiscardi/rust-adventure/target/debug/deps/hello_world-5edb99e9dd6fe5cd

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running /Users/chris/github/christopherbiscardi/rust-adventure/target/debug/deps/output-1191747d69332647

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out

digital-garden's People

Contributors

christopherbiscardi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vdikan mlevkov

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.