diff --git a/exercises/practice/list-ops/.meta/tests.toml b/exercises/practice/list-ops/.meta/tests.toml index a0219b669..7daa3b798 100644 --- a/exercises/practice/list-ops/.meta/tests.toml +++ b/exercises/practice/list-ops/.meta/tests.toml @@ -106,7 +106,10 @@ reimplements = "be396a53-c074-4db3-8dd6-f7ed003cce7c" description = "reverse the elements of the list -> empty list" [fcc03d1e-42e0-4712-b689-d54ad761f360] -description = "reverse the elements of the list -> non-empty list" +description = "reverse the elements of the list -> non-empty even-length list" + +[64d77184-5f74-4845-b158-545d2dd2df98] +description = "reverse the elements of the list -> non-empty odd-length list" [40872990-b5b8-4cb8-9085-d91fc0d05d26] description = "reverse the elements of the list -> list of lists is not flattened" diff --git a/exercises/practice/list-ops/ListOpsTest.php b/exercises/practice/list-ops/ListOpsTest.php index 6e0e8979e..c29e7ceb9 100644 --- a/exercises/practice/list-ops/ListOpsTest.php +++ b/exercises/practice/list-ops/ListOpsTest.php @@ -235,7 +235,7 @@ public function testFoldrDirectionDependentNonEmptyList() /** * uuid 94231515-050e-4841-943d-d4488ab4ee30 */ - #[TestDox('Reverse the elements of a list -> Empty list')] + #[TestDox('Reverse the elements of the list -> Empty list')] public function testReverseEmptyList() { $listOps = new ListOps(); @@ -245,17 +245,27 @@ public function testReverseEmptyList() /** * uuid fcc03d1e-42e0-4712-b689-d54ad761f360 */ - #[TestDox('Reverse the elements of a list -> Non-empty list')] - public function testReverseNonEmptyList() + #[TestDox('Reverse the elements of the list -> Non-empty even-length list')] + public function testReverseNonEmptyEvenLengthList() { $listOps = new ListOps(); $this->assertEquals([7, 5, 3, 1], $listOps->reverse([1, 3, 5, 7])); } + /** + * uuid 64d77184-5f74-4845-b158-545d2dd2df98 + */ + #[TestDox('Reverse the elements of the list -> Non-empty odd-length list')] + public function testReverseNonEmptyOddLengthList() + { + $listOps = new ListOps(); + $this->assertEquals([13, 11, 9, 7, 5, 3, 1], $listOps->reverse([1, 3, 5, 7, 9, 11, 13])); + } + /** * uuid 40872990-b5b8-4cb8-9085-d91fc0d05d26 */ - #[TestDox('Reverse the elements of a list -> List of lists is not flattened')] + #[TestDox('Reverse the elements of the list -> List of lists is not flattened')] public function testReverseNonEmptyListIsNotFlattened() { $listOps = new ListOps();