]> git.giacomolli.uk - onechat/blobdiff - routes_test.go
Share general review and documentation rules
[onechat] / routes_test.go
index 2aadc7e7f2925dc444740325aa8070743c8794c2..6e11c7a9d43a3a6d9d6978e12843331bc3a623e1 100644 (file)
@@ -46,43 +46,43 @@ func TestRoutesRefuseUnknownSourcesAndNonchildren(t *testing.T) {
                cause  string
        }{
                {
                cause  string
        }{
                {
-                       name:   "unknown kind",
+                       name:   "refuses unknown kind",
                        source: "mail:inbox",
                        agent:  "Garden",
                        cause:  "unknown source kind",
                },
                {
                        source: "mail:inbox",
                        agent:  "Garden",
                        cause:  "unknown source kind",
                },
                {
-                       name:   "missing kind",
+                       name:   "refuses missing kind",
                        source: whatsappTestFamily.String(),
                        agent:  "Garden",
                        cause:  "unknown source kind",
                },
                {
                        source: whatsappTestFamily.String(),
                        agent:  "Garden",
                        cause:  "unknown source kind",
                },
                {
-                       name:   "empty chat",
+                       name:   "refuses empty chat",
                        source: "whatsapp:",
                        agent:  "Garden",
                        cause:  "invalid WhatsApp source",
                },
                {
                        source: "whatsapp:",
                        agent:  "Garden",
                        cause:  "invalid WhatsApp source",
                },
                {
-                       name:   "unknown chat kind",
+                       name:   "refuses unknown chat kind",
                        source: "whatsapp:example@unknown",
                        agent:  "Garden",
                        cause:  "invalid WhatsApp source",
                },
                {
                        source: "whatsapp:example@unknown",
                        agent:  "Garden",
                        cause:  "invalid WhatsApp source",
                },
                {
-                       name:   "root is not a child",
+                       name:   "refuses root is not a child",
                        source: "whatsapp:" + whatsappTestFamily.String(),
                        agent:  "OneChat",
                        cause:  "must be a child",
                },
                {
                        source: "whatsapp:" + whatsappTestFamily.String(),
                        agent:  "OneChat",
                        cause:  "must be a child",
                },
                {
-                       name:   "unknown child",
+                       name:   "refuses unknown child",
                        source: "whatsapp:" + whatsappTestFamily.String(),
                        agent:  "Other",
                        cause:  "must be a child",
                },
                {
                        source: "whatsapp:" + whatsappTestFamily.String(),
                        agent:  "Other",
                        cause:  "must be a child",
                },
                {
-                       name:   "empty child",
+                       name:   "refuses empty child",
                        source: "whatsapp:" + whatsappTestFamily.String(),
                        agent:  "",
                        cause:  "must be a child",
                        source: "whatsapp:" + whatsappTestFamily.String(),
                        agent:  "",
                        cause:  "must be a child",
@@ -134,15 +134,15 @@ func TestInvalidRouteFileStopsStartup(t *testing.T) {
                text string
        }{
                {
                text string
        }{
                {
-                       name: "invalid JSON",
+                       name: "stops startup for invalid JSON",
                        text: "{",
                },
                {
                        text: "{",
                },
                {
-                       name: "unknown source",
+                       name: "stops startup for unknown source",
                        text: `{"mail:inbox":"Garden"}`,
                },
                {
                        text: `{"mail:inbox":"Garden"}`,
                },
                {
-                       name: "empty destination",
+                       name: "stops startup for empty destination",
                        text: `{"whatsapp:example@lid":""}`,
                },
        }
                        text: `{"whatsapp:example@lid":""}`,
                },
        }