summaryrefslogtreecommitdiffstats
path: root/model/command_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/command_test.go')
-rw-r--r--model/command_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/model/command_test.go b/model/command_test.go
index 0581625d9..d362d8f2c 100644
--- a/model/command_test.go
+++ b/model/command_test.go
@@ -84,6 +84,26 @@ func TestCommandIsValid(t *testing.T) {
if err := o.IsValid(); err != nil {
t.Fatal(err)
}
+
+ o.DisplayName = strings.Repeat("1", 65)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.DisplayName = strings.Repeat("1", 64)
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
+
+ o.Description = strings.Repeat("1", 129)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.Description = strings.Repeat("1", 128)
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
}
func TestCommandPreSave(t *testing.T) {