mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-05 17:53:29 +02:00
Clean up and unify exercises
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
// tests1.rs
|
||||
//
|
||||
// Tests are important to ensure that your code does what you think it should
|
||||
// do. Tests can be run on this file with the following command: rustlings run
|
||||
// tests1
|
||||
//
|
||||
// This test has a problem with it -- make the test compile! Make the test pass!
|
||||
// Make the test fail!
|
||||
//
|
||||
// Execute `rustlings hint tests1` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
fn main() {
|
||||
// You can optionally experiment here.
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
// tests2.rs
|
||||
//
|
||||
// This test has a problem with it -- make the test compile! Make the test pass!
|
||||
// Make the test fail!
|
||||
//
|
||||
// Execute `rustlings hint tests2` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
fn main() {
|
||||
// You can optionally experiment here.
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
// tests3.rs
|
||||
//
|
||||
// This test isn't testing our function -- make it do that in such a way that
|
||||
// the test passes. Then write a second test that tests whether we get the
|
||||
// result we expect to get when we call `is_even(5)`.
|
||||
//
|
||||
// Execute `rustlings hint tests3` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
pub fn is_even(num: i32) -> bool {
|
||||
num % 2 == 0
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
// tests4.rs
|
||||
//
|
||||
// Make sure that we're testing for the correct conditions!
|
||||
//
|
||||
// Execute `rustlings hint tests4` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
struct Rectangle {
|
||||
width: i32,
|
||||
|
||||
Reference in New Issue
Block a user