Browse Source

adding modules

content-update
MSilva95 3 years ago
parent
commit
dfed32ff87
  1. 7
      rust/tests/adding_test/Cargo.lock
  2. 1
      rust/tests/adding_test/src/main.rs
  3. 7
      rust/tests/adding_twice_test/Cargo.lock
  4. 2
      rust/tests/adding_twice_test/src/main.rs
  5. 75
      rust/tests/changes_test/Cargo.lock
  6. 7
      rust/tests/diamond_creation_test/Cargo.lock
  7. 2
      rust/tests/diamond_creation_test/src/main.rs
  8. 1
      rust/tests/find_factorial_test/src/main.rs
  9. 2
      rust/tests/get_products_test/src/main.rs
  10. 7
      rust/tests/highest_test/Cargo.lock
  11. 1
      rust/tests/highest_test/src/main.rs
  12. 10
      rust/tests/iterators_test/Cargo.lock
  13. 1
      rust/tests/iterators_test/src/main.rs
  14. 2
      rust/tests/logic_number_test/src/main.rs
  15. 7
      rust/tests/ordinal_test/Cargo.lock
  16. 1
      rust/tests/ordinal_test/src/main.rs
  17. 10
      rust/tests/pangram_test/Cargo.lock
  18. 2
      rust/tests/pangram_test/src/main.rs
  19. 7
      rust/tests/pig_latin_test/Cargo.lock
  20. 2
      rust/tests/pig_latin_test/src/main.rs
  21. 2
      rust/tests/reverse_string_test/src/main.rs
  22. 7
      rust/tests/rgb_match_test/Cargo.lock
  23. 1
      rust/tests/rgb_match_test/src/main.rs
  24. 7
      rust/tests/rot_test/Cargo.lock
  25. 1
      rust/tests/rot_test/src/main.rs
  26. 1
      rust/tests/scores_test/src/main.rs
  27. 7
      rust/tests/searching_test/Cargo.lock
  28. 1
      rust/tests/searching_test/src/main.rs
  29. 10
      rust/tests/simple_hash_test/Cargo.lock
  30. 8
      rust/tests/spelling_test/Cargo.lock
  31. 2
      rust/tests/spelling_test/src/main.rs
  32. 7
      rust/tests/stars_test/Cargo.lock
  33. 1
      rust/tests/stars_test/src/main.rs
  34. 7
      rust/tests/talking_test/Cargo.lock
  35. 2
      rust/tests/talking_test/src/main.rs

7
rust/tests/adding_test/Cargo.lock diff.generated

@ -4,3 +4,10 @@
name = "adding"
version = "0.1.0"
[[package]]
name = "adding_test"
version = "0.1.0"
dependencies = [
"adding 0.1.0",
]

1
rust/tests/adding_test/src/main.rs

@ -7,6 +7,7 @@ Create the function `add_curry` that returns a closure.
The purpose is to curry the add method to create more variations.
*/
use adding::*;
fn main() {
let add10 = add_curry(-10);
let add20 = add_curry(2066);

7
rust/tests/adding_twice_test/Cargo.lock diff.generated

@ -4,3 +4,10 @@
name = "adding_twice"
version = "0.1.0"
[[package]]
name = "adding_twice_test"
version = "0.1.0"
dependencies = [
"adding_twice 0.1.0",
]

2
rust/tests/adding_twice_test/src/main.rs

@ -13,7 +13,7 @@ to the original value.
- https://doc.rust-lang.org/rust-by-example/fn/hof.html#higher-order-functions
*/
use adding_twice::*;
fn main() {
let add10 = add_curry(10);
let value = twice(add10);

75
rust/tests/changes_test/Cargo.lock diff.generated

@ -1,8 +1,24 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "assert_cmd"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dc1679af9a1ab4bea16f228b05d18f8363f8327b1fa8db00d2760cfafc6b61e"
dependencies = [
"doc-comment",
"predicates",
"predicates-core",
"predicates-tree",
"wait-timeout",
]
[[package]]
name = "changes"
version = "0.1.0"
dependencies = [
"assert_cmd",
]
[[package]]
name = "changes_test"
@ -10,3 +26,62 @@ version = "0.1.0"
dependencies = [
"changes",
]
[[package]]
name = "difference"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
[[package]]
name = "doc-comment"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "libc"
version = "0.2.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
[[package]]
name = "predicates"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73dd9b7b200044694dfede9edf907c1ca19630908443e9447e624993700c6932"
dependencies = [
"difference",
"predicates-core",
]
[[package]]
name = "predicates-core"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb3dbeaaf793584e29c58c7e3a82bbb3c7c06b63cea68d13b0e3cddc124104dc"
[[package]]
name = "predicates-tree"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aee95d988ee893cb35c06b148c80ed2cd52c8eea927f50ba7a0be1a786aeab73"
dependencies = [
"predicates-core",
"treeline",
]
[[package]]
name = "treeline"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
[[package]]
name = "wait-timeout"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
dependencies = [
"libc",
]

7
rust/tests/diamond_creation_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "diamond_creation"
version = "0.1.0"
[[package]]
name = "diamond_creation_test"
version = "0.1.0"
dependencies = [
"diamond_creation",
]

2
rust/tests/diamond_creation_test/src/main.rs

@ -51,7 +51,7 @@ E·······E
····A····
*/
use diamond_creation::*;
fn main() {
println!("{:?}", make_diamond('A'));
println!("{:?}", make_diamond('C'));

1
rust/tests/find_factorial_test/src/main.rs

@ -1,4 +1,5 @@
// Complete this function to return the factorial of a given number
use find_factorial::*;
pub fn factorial(num: u64) -> u64 {
match num {

2
rust/tests/get_products_test/src/main.rs

@ -13,7 +13,7 @@ Input: arr[] = {10, 3, 5, 6, 2}
Output: prod[] = {180, 600, 360, 300, 900}
*/
use get_products::*;
fn main() {
let arr: Vec<usize> = vec![1, 7, 3, 4];
let output = get_products(arr);

7
rust/tests/highest_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "highest"
version = "0.1.0"
[[package]]
name = "highest_test"
version = "0.1.0"
dependencies = [
"highest",
]

1
rust/tests/highest_test/src/main.rs

@ -15,6 +15,7 @@
- https://doc.rust-lang.org/book/ch13-02-iterators.html
*/
use highest::*;
#[derive(Debug)]
struct Numbers<'a> {

10
rust/tests/iterators_test/Cargo.lock diff.generated

@ -1,5 +1,13 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "even_iterator"
name = "iterators"
version = "0.1.0"
[[package]]
name = "iterators_test"
version = "0.1.0"
dependencies = [
"iterators 0.1.0",
]

1
rust/tests/iterators_test/src/main.rs

@ -19,6 +19,7 @@ and the third will be the factorial numbers.
- https://doc.rust-lang.org/std/iter/trait.Iterator.html
*/
use iterators::*;
fn main() {
let mut a = Number::new(5);

2
rust/tests/logic_number_test/src/main.rs

@ -16,7 +16,7 @@ and false otherwise.
153 returns true, because: 153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153
154 returns false, because: 154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190
*/
use logic_number::*;
fn main() {
let array = [9, 10, 153, 154];
for pat in &array {

7
rust/tests/ordinal_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "ordinal"
version = "0.1.0"
[[package]]
name = "ordinal_test"
version = "0.1.0"
dependencies = [
"ordinal",
]

1
rust/tests/ordinal_test/src/main.rs

@ -6,6 +6,7 @@
Complete the function "num_to_ordinal" that receives a cardinal number and returns its ordinal number.
*/
use ordinal::*;
fn main() {
println!("{}", num_to_ordinal(1));

10
rust/tests/pangram_test/Cargo.lock diff.generated

@ -1,5 +1,13 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "panaram"
name = "pangram"
version = "0.1.0"
[[package]]
name = "pangram_test"
version = "0.1.0"
dependencies = [
"pangram 0.1.0",
]

2
rust/tests/pangram_test/src/main.rs

@ -11,7 +11,7 @@ Example:
"The quick brown fox jumps over the lazy dog."
*/
use pangram::*;
use std::collections::HashSet;
fn main() {

7
rust/tests/pig_latin_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "pig_latin"
version = "0.1.0"
[[package]]
name = "pig_latin_test"
version = "0.1.0"
dependencies = [
"pig_latin",
]

2
rust/tests/pig_latin_test/src/main.rs

@ -17,7 +17,7 @@ The rules used by Pig Latin are the following:
- https://doc.rust-lang.org/book/ch18-00-patterns.html
*/
use pig_latin::*;
fn main() {
println!("{}", pig_latin(&String::from("igloo")));
println!("{}", pig_latin(&String::from("apple")));

2
rust/tests/reverse_string_test/src/main.rs

@ -1,4 +1,5 @@
// Write a function `rev_str` that takes a `&str` as a parameter, and returns a string with its words reversed.
use reverse_string::rev_str;
#[allow(dead_code)]
fn main() {
@ -9,7 +10,6 @@ fn main() {
println!("{}", rev_str("ex: this is an example água"));
}
use reverse_string::rev_str;
#[allow(dead_code)]
fn test_reverse(input: &str, expected: &str) {

7
rust/tests/rgb_match_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "rgb_match"
version = "0.1.0"
[[package]]
name = "rgb_match_test"
version = "0.1.0"
dependencies = [
"rgb_match",
]

1
rust/tests/rgb_match_test/src/main.rs

@ -11,6 +11,7 @@ This function must allow you to swap the values of the struct.
If the struct has this values -> Color { r: 255,g: 200,b: 10,a: 30,} and
you want to `swap(c.a, c.g)` you will get -> Color { r: 255, g: 30, b: 10, a: 200 }
*/
use rgb_match::*;
#[derive(Debug, Clone, Copy, PartialEq)]
struct Color {

7
rust/tests/rot_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "rot"
version = "0.1.0"
[[package]]
name = "rot_test"
version = "0.1.0"
dependencies = [
"rot",
]

1
rust/tests/rot_test/src/main.rs

@ -31,6 +31,7 @@ they will remain the same.
Here is a program to test your function.
*/
use rot::*;
fn main() {

1
rust/tests/scores_test/src/main.rs

@ -25,6 +25,7 @@ So if yo pass the word "Hello" you will have the score 8 returned.
Any type of special character or punctuation marks has a value of 0 so if you have
"Á~,!" it will return 0.
*/
use scores::*;
fn main() {
println!("{}", score("a"));

7
rust/tests/searching_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "searching"
version = "0.1.0"
[[package]]
name = "searching_test"
version = "0.1.0"
dependencies = [
"searching",
]

1
rust/tests/searching_test/src/main.rs

@ -9,6 +9,7 @@ of the given key in the array.
```
*/
use searching::*;
fn main() {
let array = [1, 3, 4, 6, 8, 9, 11];

10
rust/tests/simple_hash_test/Cargo.lock diff.generated

@ -1,12 +1,12 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "simple-hash_test"
name = "simple_hash"
version = "0.1.0"
dependencies = [
"simple_hash",
]
[[package]]
name = "simple_hash"
name = "simple_hash_test"
version = "0.1.0"
dependencies = [
"simple_hash",
]

8
rust/tests/spelling_test/Cargo.lock diff.generated

@ -77,6 +77,14 @@ dependencies = [
"rand",
]
[[package]]
name = "spelling_test"
version = "0.1.0"
dependencies = [
"rand",
"spelling",
]
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"

2
rust/tests/spelling_test/src/main.rs

@ -17,6 +17,8 @@ So, if the program generates the number:
- 1002 your function will return the string "one thousand two".
- 1000000 your function will return the string "one million"
*/
use spelling::*;
use rand::Rng;
fn main() {
let mut rng = rand::thread_rng();

7
rust/tests/stars_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "stars"
version = "0.1.0"
[[package]]
name = "stars_test"
version = "0.1.0"
dependencies = [
"stars",
]

1
rust/tests/stars_test/src/main.rs

@ -15,6 +15,7 @@ stars(3) "********" 2^3 = 8
stars(4) "****************" 2^4 = 16
*/
use stars::*;
fn main() {
println!("{}", stars(4));

7
rust/tests/talking_test/Cargo.lock diff.generated

@ -3,3 +3,10 @@
[[package]]
name = "talking"
version = "0.1.0"
[[package]]
name = "talking_test"
version = "0.1.0"
dependencies = [
"talking",
]

2
rust/tests/talking_test/src/main.rs

@ -14,7 +14,7 @@ He says "Just say something!" if you address him without actually saying anythin
He answers "Interesting" to anything else.
*/
use talking::*;
fn main() {
println!("{:?}", talking("JUST DO IT!"));
println!("{:?}", talking("Hello how are you?"));

Loading…
Cancel
Save