From 1298f9bab11689fd8d6b9fcd1710d4cb585eceb1 Mon Sep 17 00:00:00 2001 From: DagmarTimmreck Date: Wed, 28 Aug 2019 17:51:57 +0200 Subject: [PATCH 1/2] Add testcase --- exercises/matrix/canonical-data.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/exercises/matrix/canonical-data.json b/exercises/matrix/canonical-data.json index aef45d4642..079c8d4431 100644 --- a/exercises/matrix/canonical-data.json +++ b/exercises/matrix/canonical-data.json @@ -1,6 +1,6 @@ { "exercise": "matrix", - "version": "1.1.0", + "version": "1.2.0", "cases": [ { "description": "extract row from one number matrix", @@ -65,6 +65,15 @@ }, "expected": [3, 6, 9, 6] }, + { + "description": "can extract column from non-square matrix with more columns than rows", + "property": "column", + "input": { + "string": "1 2 3\n4 5 6", + "index": 3 + }, + "expected": [3, 6] + }, { "description": "extract column where numbers have different widths", "property": "column", From 577ba69339c8c4701f5d192cd03b6d4e033f52cc Mon Sep 17 00:00:00 2001 From: DagmarTimmreck Date: Thu, 29 Aug 2019 13:07:48 +0200 Subject: [PATCH 2/2] Matrix: Add symmetric test cases for non-square matrices --- exercises/matrix/canonical-data.json | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/exercises/matrix/canonical-data.json b/exercises/matrix/canonical-data.json index 079c8d4431..95edd679f2 100644 --- a/exercises/matrix/canonical-data.json +++ b/exercises/matrix/canonical-data.json @@ -30,13 +30,13 @@ "expected": [10, 20] }, { - "description": "can extract row from non-square matrix", + "description": "can extract row from non-square matrix with no corresponding column", "property": "row", "input": { "string": "1 2 3\n4 5 6\n7 8 9\n8 7 6", - "index": 3 + "index": 4 }, - "expected": [7, 8, 9] + "expected": [8, 7, 6] }, { "description": "extract column from one number matrix", @@ -57,22 +57,13 @@ "expected": [3, 6, 9] }, { - "description": "can extract column from non-square matrix", + "description": "can extract column from non-square matrix with no corresponding row", "property": "column", "input": { - "string": "1 2 3\n4 5 6\n7 8 9\n8 7 6", - "index": 3 - }, - "expected": [3, 6, 9, 6] - }, - { - "description": "can extract column from non-square matrix with more columns than rows", - "property": "column", - "input": { - "string": "1 2 3\n4 5 6", - "index": 3 + "string": "1 2 3 4\n 5 6 7 8\n 9 8 7 6", + "index": 4 }, - "expected": [3, 6] + "expected": [4, 8, 6] }, { "description": "extract column where numbers have different widths",