Skip to content

Commit 5697527

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] Trying to re-organize source code and tests
1 parent 11f55fe commit 5697527

File tree

7 files changed

+10
-4
lines changed

7 files changed

+10
-4
lines changed
File renamed without changes.

src/hackerrank/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod add;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod add;
1+
pub mod hackerrank;
File renamed without changes.

tests/add.rs renamed to tests/hackerrank/add.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
use exercises::add::add;
1+
use exercises::hackerrank::add::add;
22
use once_cell::sync::Lazy;
33
use serde::Deserialize;
44

5-
mod common;
5+
use crate::common;
66
use common::utils::load_json;
77

8+
9+
810
#[derive(Debug, Deserialize)]
911
struct AdderTestCase {
1012
title: String,
@@ -14,7 +16,7 @@ struct AdderTestCase {
1416
}
1517

1618
static TEST_DATA: Lazy<Vec<AdderTestCase>> =
17-
Lazy::new(|| load_json("tests/add.json"));
19+
Lazy::new(|| load_json("tests/data/hackerrank/add.json"));
1820

1921
#[cfg(test)]
2022
mod tests {

tests/hackerrank/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod add;

tests/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod common;
2+
pub mod hackerrank;

0 commit comments

Comments
 (0)