summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormarisa <mokou@posteo.de>2019-11-11 15:46:32 +0100
committermarisa <mokou@posteo.de>2019-11-11 15:46:32 +0100
commit627cdc07d07dfe6a740e885e0ddf6900e7ec336b (patch)
tree3720932c448d696acee467325fda9bcc1db3b478 /tests
parenta47a62172a5d4c479d242498b9b140b3111fb7c6 (diff)
feat: Index exercises by name
BREAKING CHANGE: This changes the way you use `rustlings run` by now requiring an abridged form of the previous filename, e.g: `rustlings run exercises/if/if1.rs` becomes `rustlings run if1`
Diffstat (limited to 'tests')
-rw-r--r--tests/fixture/failure/info.toml4
-rw-r--r--tests/fixture/success/info.toml4
-rw-r--r--tests/integration_tests.rs8
3 files changed, 10 insertions, 6 deletions
diff --git a/tests/fixture/failure/info.toml b/tests/fixture/failure/info.toml
index f4e7c0c..19e2bda 100644
--- a/tests/fixture/failure/info.toml
+++ b/tests/fixture/failure/info.toml
@@ -1,7 +1,9 @@
[[exercises]]
+name = "compFailure"
path = "compFailure.rs"
mode = "compile"
[[exercises]]
+name = "testFailure"
path = "testFailure.rs"
-mode = "test" \ No newline at end of file
+mode = "test"
diff --git a/tests/fixture/success/info.toml b/tests/fixture/success/info.toml
index e255db9..c6316c1 100644
--- a/tests/fixture/success/info.toml
+++ b/tests/fixture/success/info.toml
@@ -1,7 +1,9 @@
[[exercises]]
+name = "compSuccess"
path = "compSuccess.rs"
mode = "compile"
[[exercises]]
+name = "testSuccess"
path = "testSuccess.rs"
-mode = "test" \ No newline at end of file
+mode = "test"
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 3acaf90..652ba60 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -40,7 +40,7 @@ fn verify_all_failure() {
fn run_single_compile_success() {
Command::cargo_bin("rustlings")
.unwrap()
- .args(&["r", "compSuccess.rs"])
+ .args(&["r", "compSuccess"])
.current_dir("tests/fixture/success/")
.assert()
.success();
@@ -50,7 +50,7 @@ fn run_single_compile_success() {
fn run_single_compile_failure() {
Command::cargo_bin("rustlings")
.unwrap()
- .args(&["r", "compFailure.rs"])
+ .args(&["r", "compFailure"])
.current_dir("tests/fixture/failure/")
.assert()
.code(1);
@@ -60,7 +60,7 @@ fn run_single_compile_failure() {
fn run_single_test_success() {
Command::cargo_bin("rustlings")
.unwrap()
- .args(&["r", "testSuccess.rs"])
+ .args(&["r", "testSuccess"])
.current_dir("tests/fixture/success/")
.assert()
.success();
@@ -70,7 +70,7 @@ fn run_single_test_success() {
fn run_single_test_failure() {
Command::cargo_bin("rustlings")
.unwrap()
- .args(&["r", "testFailure.rs"])
+ .args(&["r", "testFailure"])
.current_dir("tests/fixture/failure/")
.assert()
.code(1);