From 615cd62e18380d404c9acc1d70a44c45430044f4 Mon Sep 17 00:00:00 2001 From: Thomas Zumsteg Date: Thu, 21 Jan 2016 09:50:59 -0800 Subject: [PATCH] Updated bracket push to match new tests and naming --- bracket-push/{brachet-push.go => bracket_push.go} | 5 ++++- .../{bracket-push_test.go => bracket_push_test.go} | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) rename bracket-push/{brachet-push.go => bracket_push.go} (89%) rename bracket-push/{bracket-push_test.go => bracket_push_test.go} (87%) diff --git a/bracket-push/brachet-push.go b/bracket-push/bracket_push.go similarity index 89% rename from bracket-push/brachet-push.go rename to bracket-push/bracket_push.go index 4f51417..97b7061 100644 --- a/bracket-push/brachet-push.go +++ b/bracket-push/bracket_push.go @@ -1,8 +1,11 @@ -package bracket_push +package brackets //bracketType sorts characters into either opening, closing, or not a bracket type bracketType int +//TestVersion is the version of unit tests that this will pass +const TestVersion = 2 + const ( openBracket bracketType = iota closeBracket diff --git a/bracket-push/bracket-push_test.go b/bracket-push/bracket_push_test.go similarity index 87% rename from bracket-push/bracket-push_test.go rename to bracket-push/bracket_push_test.go index 1b3146d..a4a7eed 100644 --- a/bracket-push/bracket-push_test.go +++ b/bracket-push/bracket_push_test.go @@ -1,9 +1,11 @@ -package bracket_push +package brackets import ( "testing" ) +const testVersion = 2 + var testCases = []struct { input string expected bool @@ -58,6 +60,9 @@ func TestBracket(t *testing.T) { tt.input, tt.expected, actual) } } + if TestVersion != testVersion { + t.Fatalf("Found TestVersion = %v, want %v.", TestVersion, testVersion) + } } func BenchmarkBracket(b *testing.B) {