summaryrefslogtreecommitdiffstats
path: root/models/unit_tests.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-07-26 18:20:38 -0700
committerLunny Xiao <xiaolunwen@gmail.com>2017-07-27 09:20:38 +0800
commita27863b6d15026cf36b164707331fd59ffb68931 (patch)
tree82bd393e796d4330213599b492b40b0100288c8a /models/unit_tests.go
parent5f37944dff7f8e48b3c5ce27bd1b77907b71f092 (diff)
downloadgitea-a27863b6d15026cf36b164707331fd59ffb68931.tar.gz
gitea-a27863b6d15026cf36b164707331fd59ffb68931.zip
Fix issue updated_unix bug (#2204)
Diffstat (limited to 'models/unit_tests.go')
-rw-r--r--models/unit_tests.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/unit_tests.go b/models/unit_tests.go
index 774fb883c6..b4b36ba6b7 100644
--- a/models/unit_tests.go
+++ b/models/unit_tests.go
@@ -92,3 +92,9 @@ func AssertSuccessfulInsert(t *testing.T, beans ...interface{}) {
func AssertCount(t *testing.T, bean interface{}, expected interface{}) {
assert.EqualValues(t, expected, GetCount(t, bean))
}
+
+// AssertInt64InRange assert value is in range [low, high]
+func AssertInt64InRange(t *testing.T, low, high, value int64) {
+ assert.True(t, value >= low && value <= high,
+ "Expected value in range [%d, %d], found %d", low, high, value)
+}