From 969c05e1017dc38b4433002bde8b08513210e618 Mon Sep 17 00:00:00 2001 From: Kurlgargyey Date: Mon, 6 May 2024 13:39:31 +0200 Subject: [PATCH] add test for zero-length case Added a test to check for correct behavior when passing 0 as len --- exercises/practice/series/tests/series.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/exercises/practice/series/tests/series.rs b/exercises/practice/series/tests/series.rs index dc73172ee..2000fc49e 100644 --- a/exercises/practice/series/tests/series.rs +++ b/exercises/practice/series/tests/series.rs @@ -90,3 +90,13 @@ fn empty_series_is_invalid() { let expected: &[&str] = &[]; assert_eq!(output, expected); } + +#[test] +#[ignore] +fn zero_length_series_returns_empty_strings() { + let input = "12345"; + let length = 0; + let output = series(input, length); + let expected: &[&str] = &[""; 6]; + assert_eq!(output, expected) +}