summaryrefslogtreecommitdiff
path: root/exercises
diff options
context:
space:
mode:
authorAxel Viala <axel.viala@darnuria.eu>2020-10-10 16:04:19 +0200
committerGitHub <noreply@github.com>2020-10-10 16:04:19 +0200
commit2b1fb2b739bf9ad8d6b7b12af25fee173011bfc4 (patch)
tree25d6007cd92527cbb9f570bd3a97b230af2d7661 /exercises
parent18e0bfef1de53071e353ba1ec5837002ff7290e6 (diff)
feat(primitive_types6): Add a test (#548)
Co-authored-by: Annika <56906084+AnnikaCodes@users.noreply.github.com> Co-authored-by: fmoko <mokou@posteo.de>
Diffstat (limited to 'exercises')
-rw-r--r--exercises/primitive_types/primitive_types6.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/exercises/primitive_types/primitive_types6.rs b/exercises/primitive_types/primitive_types6.rs
index 2bc817e..5c6c5a4 100644
--- a/exercises/primitive_types/primitive_types6.rs
+++ b/exercises/primitive_types/primitive_types6.rs
@@ -1,11 +1,16 @@
// primitive_types6.rs
// Use a tuple index to access the second element of `numbers`.
-// You can put this right into the `println!` where the ??? is.
+// You can put the expression for the second element where ??? is so that the test passes.
// Execute `rustlings hint primitive_types6` for hints!
// I AM NOT DONE
-fn main() {
+#[test]
+fn indexing_tuple() {
let numbers = (1, 2, 3);
- println!("The second number is {}", ???);
+ /// Replace below ??? with the tuple indexing syntax.
+ let second = ???;
+
+ assert_eq!(2, second
+ "This is not the 2nd number in the tuple!")
}