summaryrefslogtreecommitdiff
path: root/examples/docker/admin/cmd/ponzu/cli_test.go
diff options
context:
space:
mode:
authorkmeister <kris@aliencom.net>2017-04-13 18:32:00 -0400
committerkmeister <kris@aliencom.net>2017-04-13 18:32:00 -0400
commit9840fc2341f125f64a6089366197ca9012a9026f (patch)
tree991d793c31ab49655ce258629a6b52f07c8fc2b8 /examples/docker/admin/cmd/ponzu/cli_test.go
parentc77e28d30ee407b073bd71f12951571b8fe63959 (diff)
[docker-exampe] moved into examples repo https://github.com/ponzu-cms/examples
Diffstat (limited to 'examples/docker/admin/cmd/ponzu/cli_test.go')
-rw-r--r--examples/docker/admin/cmd/ponzu/cli_test.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/examples/docker/admin/cmd/ponzu/cli_test.go b/examples/docker/admin/cmd/ponzu/cli_test.go
deleted file mode 100644
index 76feac3..0000000
--- a/examples/docker/admin/cmd/ponzu/cli_test.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package main
-
-import "testing"
-
-func TestParseType(t *testing.T) {
- // blog title:string Author:string PostCategory:string content:string some_thing:int
- args := []string{
- "blog", "title:string", "Author:string",
- "PostCategory:string", "content:string",
- "some_thing:int", "Some_otherThing:float64",
- }
-
- gt, err := parseType(args)
- if err != nil {
- t.Errorf("Failed: %s", err.Error())
- }
-
- if gt.Name != "Blog" {
- t.Errorf("Expected %s, got: %s", "Blog", gt.Name)
- }
-}
-
-func TestFieldJSONName(t *testing.T) {
- cases := map[string]string{
- "_T": "t",
- "T": "t",
- "_tT_": "t_t_",
- "TestCapsNoSym": "test_caps_no_sym",
- "test_Some_caps_Sym": "test_some_caps_sym",
- "testnocaps": "testnocaps",
- "_Test_Caps_Sym_odd": "test_caps_sym_odd",
- "test-hyphen": "test-hyphen",
- "Test-hyphen-Caps": "test-hyphen-caps",
- "Test-Hyphen_Sym-Caps": "test-hyphen_sym-caps",
- }
-
- for input, expected := range cases {
- output := fieldJSONName(input)
- if output != expected {
- t.Errorf("Expected: %s, got: %s", expected, output)
- }
- }
-}
-
-func TestFieldName(t *testing.T) {
- cases := map[string]string{
- "_T": "T",
- "T": "T",
- "_tT_": "TT",
- "TestCapsNoSym": "TestCapsNoSym",
- "test_Some_caps_Sym": "TestSomeCapsSym",
- "testnocaps": "Testnocaps",
- "_Test_Caps_Sym_odd": "TestCapsSymOdd",
- "test-hyphen": "TestHyphen",
- "Test-hyphen-Caps": "TestHyphenCaps",
- "Test-Hyphen_Sym-Caps": "TestHyphenSymCaps",
- }
-
- for input, expected := range cases {
- output := fieldName(input)
- if output != expected {
- t.Errorf("Expected: %s, got: %s", expected, output)
- }
- }
-}