From e0321297554d89bd0fed0f1adfe81bfff9f61eaa Mon Sep 17 00:00:00 2001 From: Derk-Jan Karrenbeld Date: Mon, 15 Apr 2019 12:34:59 +0200 Subject: [PATCH 1/2] bracket-push: rename to matching-brackets This rename was proposed in: exercism/problem-specifications#1501 The rationale for the name is: * to name the exercise by its story, not by what it potentially teaches * to avoid unnecessarily biasing the solution space --- config.json | 8 ++-- .../.editorconfig | 2 +- .../Example.cs | 2 +- .../MatchingBrackets.cs} | 2 +- .../MatchingBrackets.csproj} | 0 .../MatchingBracketsTest.cs} | 38 +++++++++---------- .../README.md | 6 +-- 7 files changed, 29 insertions(+), 29 deletions(-) rename exercises/{bracket-push => matching-brackets}/.editorconfig (99%) rename exercises/{bracket-push => matching-brackets}/Example.cs (93%) rename exercises/{bracket-push/BracketPush.cs => matching-brackets/MatchingBrackets.cs} (76%) rename exercises/{bracket-push/BracketPush.csproj => matching-brackets/MatchingBrackets.csproj} (100%) rename exercises/{bracket-push/BracketPushTest.cs => matching-brackets/MatchingBracketsTest.cs} (69%) rename exercises/{bracket-push => matching-brackets}/README.md (90%) diff --git a/config.json b/config.json index e6a5bfd531..bf6323681c 100644 --- a/config.json +++ b/config.json @@ -185,7 +185,7 @@ ] }, { - "slug": "bracket-push", + "slug": "matching-brackets", "uuid": "a2070019-e56d-4d48-994b-300411598707", "core": true, "unlocked_by": null, @@ -926,7 +926,7 @@ "slug": "linked-list", "uuid": "49b557ad-0bf0-451b-9a12-6dd9eb0291a2", "core": false, - "unlocked_by": "bracket-push", + "unlocked_by": "matching-brackets", "difficulty": 5, "topics": [ "classes", @@ -971,7 +971,7 @@ "slug": "dot-dsl", "uuid": "d128ec4b-190f-4726-b3e7-870be09531aa", "core": false, - "unlocked_by": "bracket-push", + "unlocked_by": "matching-brackets", "difficulty": 5, "topics": [ "classes", @@ -1199,7 +1199,7 @@ "slug": "diamond", "uuid": "2f3faeb7-7cc3-42ed-9525-cd9c73922a8d", "core": false, - "unlocked_by": "bracket-push", + "unlocked_by": "matching-brackets", "difficulty": 8, "topics": [ "algorithms", diff --git a/exercises/bracket-push/.editorconfig b/exercises/matching-brackets/.editorconfig similarity index 99% rename from exercises/bracket-push/.editorconfig rename to exercises/matching-brackets/.editorconfig index 5a99b307f1..b1d5796f21 100644 --- a/exercises/bracket-push/.editorconfig +++ b/exercises/matching-brackets/.editorconfig @@ -12,7 +12,7 @@ root = true [*] indent_style = space -[BracketPush.cs] +[MatchingBrackets.cs] indent_size = 4 ############################### diff --git a/exercises/bracket-push/Example.cs b/exercises/matching-brackets/Example.cs similarity index 93% rename from exercises/bracket-push/Example.cs rename to exercises/matching-brackets/Example.cs index f95667ab28..b2b53f79b5 100644 --- a/exercises/bracket-push/Example.cs +++ b/exercises/matching-brackets/Example.cs @@ -1,6 +1,6 @@ using System.Linq; -public static class BracketPush +public static class MatchingBrackets { public static bool IsPaired(string input) { diff --git a/exercises/bracket-push/BracketPush.cs b/exercises/matching-brackets/MatchingBrackets.cs similarity index 76% rename from exercises/bracket-push/BracketPush.cs rename to exercises/matching-brackets/MatchingBrackets.cs index 18157752aa..e34176bd67 100644 --- a/exercises/bracket-push/BracketPush.cs +++ b/exercises/matching-brackets/MatchingBrackets.cs @@ -1,6 +1,6 @@ using System; -public static class BracketPush +public static class MatchingBrackets { public static bool IsPaired(string input) { diff --git a/exercises/bracket-push/BracketPush.csproj b/exercises/matching-brackets/MatchingBrackets.csproj similarity index 100% rename from exercises/bracket-push/BracketPush.csproj rename to exercises/matching-brackets/MatchingBrackets.csproj diff --git a/exercises/bracket-push/BracketPushTest.cs b/exercises/matching-brackets/MatchingBracketsTest.cs similarity index 69% rename from exercises/bracket-push/BracketPushTest.cs rename to exercises/matching-brackets/MatchingBracketsTest.cs index 7e1cacef4b..47158b91d1 100644 --- a/exercises/bracket-push/BracketPushTest.cs +++ b/exercises/matching-brackets/MatchingBracketsTest.cs @@ -2,124 +2,124 @@ using Xunit; -public class BracketPushTest +public class MatchingBracketsTest { [Fact] public void Paired_square_brackets() { var value = "[]"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Empty_string() { var value = ""; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Unpaired_brackets() { var value = "[["; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Wrong_ordered_brackets() { var value = "}{"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Wrong_closing_bracket() { var value = "{]"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Paired_with_whitespace() { var value = "{ }"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Partially_paired_brackets() { var value = "{[])"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Simple_nested_brackets() { var value = "{[]}"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Several_paired_brackets() { var value = "{}[]"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Paired_and_nested_brackets() { var value = "([{}({}[])])"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Unopened_closing_brackets() { var value = "{[)][]}"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Unpaired_and_nested_brackets() { var value = "([{])"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Paired_and_wrong_nested_brackets() { var value = "[({]})"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Paired_and_incomplete_brackets() { var value = "{}["; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Too_many_closing_brackets() { var value = "[]]"; - Assert.False(BracketPush.IsPaired(value)); + Assert.False(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Math_expression() { var value = "(((185 + 223.85) * 15) - 543)/2"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } [Fact(Skip = "Remove to run test")] public void Complex_latex_expression() { var value = "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)"; - Assert.True(BracketPush.IsPaired(value)); + Assert.True(MatchingBrackets.IsPaired(value)); } -} \ No newline at end of file +} diff --git a/exercises/bracket-push/README.md b/exercises/matching-brackets/README.md similarity index 90% rename from exercises/bracket-push/README.md rename to exercises/matching-brackets/README.md index 700de4d460..5c1ad46e0e 100644 --- a/exercises/bracket-push/README.md +++ b/exercises/matching-brackets/README.md @@ -1,4 +1,4 @@ -# Bracket Push +# Matching Brackets Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched @@ -10,8 +10,8 @@ To run the tests, run the command `dotnet test` from within the exercise directo Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit BracketPush.cs` +Once none of the tests are skipped and they are all passing, you can submit your solution +using `exercism submit MatchingBrackets.cs` ## Further information From c02a5ed5157617046e9e98ef5515fcdb0721f704 Mon Sep 17 00:00:00 2001 From: Derk-Jan Karrenbeld Date: Mon, 15 Apr 2019 12:47:43 +0200 Subject: [PATCH 2/2] :eyes: rename .sln reference --- exercises/Exercises.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/Exercises.sln b/exercises/Exercises.sln index eb2a496abc..829316f849 100644 --- a/exercises/Exercises.sln +++ b/exercises/Exercises.sln @@ -30,7 +30,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookStore", "book-store\Boo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bowling", "bowling\Bowling.csproj", "{CE0CA302-A594-422D-A215-E78F2F3AF0CE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BracketPush", "bracket-push\BracketPush.csproj", "{A9584773-6FD0-42CB-B94E-A61125C5C1E7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchingBrackets", "matching-brackets\MatchingBrackets.csproj", "{A9584773-6FD0-42CB-B94E-A61125C5C1E7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Change", "change\Change.csproj", "{31595C04-4C0E-4A72-90A1-054EE5C47BFC}" EndProject