From 3605ed457bf7f8caa1371b4fafadadc026673479 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Thu, 26 Jul 2018 12:35:41 +1000 Subject: [PATCH] Add tests for untested methods --- snake_test.go | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/snake_test.go b/snake_test.go index 8a9930e..9c0f9d2 100644 --- a/snake_test.go +++ b/snake_test.go @@ -89,3 +89,59 @@ func TestToDelimited(t *testing.T) { } } } + +func TestToScreamingSnake(t *testing.T) { + cases := [][]string{ + []string{"testCase", "TEST_CASE"}, + } + for _, i := range cases { + in := i[0] + out := i[1] + result := ToScreamingSnake(in) + if result != out { + t.Error("'" + result + "' != '" + out + "'") + } + } +} + +func TestToKebab(t *testing.T) { + cases := [][]string{ + []string{"testCase", "test-case"}, + } + for _, i := range cases { + in := i[0] + out := i[1] + result := ToKebab(in) + if result != out { + t.Error("'" + result + "' != '" + out + "'") + } + } +} + +func TestToScreamingKebab(t *testing.T) { + cases := [][]string{ + []string{"testCase", "TEST-CASE"}, + } + for _, i := range cases { + in := i[0] + out := i[1] + result := ToScreamingKebab(in) + if result != out { + t.Error("'" + result + "' != '" + out + "'") + } + } +} + +func TestToScreamingDelimited(t *testing.T) { + cases := [][]string{ + []string{"testCase", "TEST.CASE"}, + } + for _, i := range cases { + in := i[0] + out := i[1] + result := ToScreamingDelimited(in, '.', true) + if result != out { + t.Error("'" + result + "' != '" + out + "'") + } + } +}