-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
23 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn count_characters(s: &str) -> u32 { | ||
s.chars().count() as u32 | ||
} |
2 changes: 1 addition & 1 deletion
2
...es/character-counting-string/src/tests.rs → .../character-counting-string/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn countdown(n: u32) -> Vec<u32> { | ||
let mut current = n; | ||
let mut result = Vec::new(); | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/countdown/src/tests.rs → challenges/countdown/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::countdown; | ||
use countdown::*; | ||
|
||
#[test] | ||
fn test_countdown() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn describe_number(n: i32) -> String { | ||
if n == 0 { | ||
return String::from("Zero"); | ||
|
2 changes: 1 addition & 1 deletion
2
...rmine-number-characteristics/src/tests.rs → ...ine-number-characteristics/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn factorial(n: u32) -> u128 { | ||
if n == 0 { | ||
return 1; | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/factorial-calculator/src/tests.rs → ...enges/factorial-calculator/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn fibonacci(n: u32) -> u32 { | ||
match n { | ||
0 => 0, | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/fibonacci/src/tests.rs → challenges/fibonacci/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::fibonacci; | ||
use fibonacci::*; | ||
|
||
#[test] | ||
fn zero() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn fizz_buzz(num: u32) -> String { | ||
match (num % 3, num % 5) { | ||
(0, 0) => "FizzBuzz".to_string(), | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/fizz-buzz/src/tests.rs → challenges/fizz-buzz/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::fizz_buzz; | ||
use fizz_buzz::*; | ||
|
||
#[test] | ||
fn should_return_fizz() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nges/graceful-error-handling/src/tests.rs → ...es/graceful-error-handling/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn hello_world() -> &'static str { | ||
"Hello, World!" | ||
} |
2 changes: 1 addition & 1 deletion
2
challenges/hello-world/src/tests.rs → challenges/hello-world/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::hello_world; | ||
use hello_world::*; | ||
|
||
#[test] | ||
fn should_return_hello_world() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn is_even(n: i32) -> bool { | ||
if n % 2 == 0 { | ||
true | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/if-else/src/tests.rs → challenges/if-else/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::is_even; | ||
use if_else::*; | ||
|
||
#[test] | ||
fn test_is_even() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn is_prime(n: u32) -> bool { | ||
if n < 2 { | ||
return false; | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/is-prime/src/tests.rs → challenges/is-prime/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::is_prime; | ||
use is_prime::*; | ||
|
||
#[test] | ||
fn test_is_prime_small_numbers() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { | ||
(a + b, a - b, a * b, a / b) | ||
} |
2 changes: 1 addition & 1 deletion
2
...nges/mathematical-operations/src/tests.rs → ...es/mathematical-operations/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::math_operations; | ||
use mathematical_operations::*; | ||
|
||
#[test] | ||
fn math_tests() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
use std::collections::HashMap; | ||
|
||
pub fn median(numbers: &mut Vec<i32>) -> f32 { | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/median-and-mode/src/tests.rs → challenges/median-and-mode/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::{median, mode}; | ||
use median_and_mode::*; | ||
|
||
#[test] | ||
fn test_median() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn sum_of_evens(start: i32, end: i32) -> i32 { | ||
if start > end { | ||
return 0; | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/sum-of-even-numbers/src/tests.rs → ...lenges/sum-of-even-numbers/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lenges/temperature-converter/src/tests.rs → ...nges/temperature-converter/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
challenges/the-from-trait/src/tests.rs → challenges/the-from-trait/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
challenges/validate-user-input/src/tests.rs → ...lenges/validate-user-input/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use crate::validate_user; | ||
use validate_user_input::*; | ||
|
||
#[test] | ||
fn test_valid_user() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
mod tests; | ||
|
||
pub fn weekday_from_number(day: u8) -> &'static str { | ||
match day { | ||
1 => "Monday", | ||
|
2 changes: 1 addition & 1 deletion
2
challenges/weekday-from-number/src/tests.rs → ...lenges/weekday-from-number/tests/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters