From f734bd0b60128dcec1886e30c78c30ecbf8b3224 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 14 May 2017 19:59:13 +0200 Subject: [PATCH] fixes #914 --- model/build.go | 8 ++++---- model/build_test.go | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/model/build.go b/model/build.go index 98ebd935b9..eb29aef7af 100644 --- a/model/build.go +++ b/model/build.go @@ -38,10 +38,10 @@ type Build struct { // Trim trims string values that would otherwise exceed // the database column sizes and fail to insert. func (b *Build) Trim() { - if len(b.Title) > 500 { - b.Title = b.Title[:500] + if len(b.Title) > 1000 { + b.Title = b.Title[:1000] } - if len(b.Message) > 500 { - b.Message = b.Message[:500] + if len(b.Message) > 2000 { + b.Message = b.Message[:2000] } } diff --git a/model/build_test.go b/model/build_test.go index f80e4f3cc9..1ac176cb1a 100644 --- a/model/build_test.go +++ b/model/build_test.go @@ -7,17 +7,17 @@ import ( ) func TestBuildTrim(t *testing.T) { - d := make([]byte, 1000) + d := make([]byte, 2000) rand.Read(d) b := Build{} b.Message = fmt.Sprintf("%X", d) - if len(b.Message) != 2000 { - t.Errorf("Failed to generate 2000 byte test string") + if len(b.Message) != 4000 { + t.Errorf("Failed to generate 4000 byte test string") } b.Trim() - if len(b.Message) != 500 { - t.Errorf("Failed to trim text string to 500 bytes") + if len(b.Message) != 2000 { + t.Errorf("Failed to trim text string to 2000 bytes") } }