diff options
author | =Corey Hulen <corey@hulen.com> | 2016-02-01 14:44:17 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-02-01 14:44:17 -0800 |
commit | b4ec6900510077253290e361d1a706e5368a45de (patch) | |
tree | 6fc7c131fa7aa5f32e3aba8102416aa23c65963d /model/version_test.go | |
parent | ea71731f838fc010cfc7511c09875184d1b2396b (diff) | |
parent | f28486c4553f7f4bccf7bf69153c2f12699705f9 (diff) | |
download | chat-b4ec6900510077253290e361d1a706e5368a45de.tar.gz chat-b4ec6900510077253290e361d1a706e5368a45de.tar.bz2 chat-b4ec6900510077253290e361d1a706e5368a45de.zip |
Fixing merge
Diffstat (limited to 'model/version_test.go')
-rw-r--r-- | model/version_test.go | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/model/version_test.go b/model/version_test.go index 33e8dc93e..d73273ce5 100644 --- a/model/version_test.go +++ b/model/version_test.go @@ -36,20 +36,28 @@ func TestSplitVersion(t *testing.T) { } func TestGetPreviousVersion(t *testing.T) { - if major, minor := GetPreviousVersion("1.0.0"); major != 0 || minor != 7 { - t.Fatal(major, minor) + if GetPreviousVersion("1.3.0") != "1.2.0" { + t.Fatal() + } + + if GetPreviousVersion("1.2.1") != "1.1.0" { + t.Fatal() + } + + if GetPreviousVersion("1.1.0") != "1.0.0" { + t.Fatal() } - if major, minor := GetPreviousVersion("0.7.0"); major != 0 || minor != 6 { - t.Fatal(major, minor) + if GetPreviousVersion("1.0.0") != "0.7.0" { + t.Fatal() } - if major, minor := GetPreviousVersion("0.7.1"); major != 0 || minor != 6 { - t.Fatal(major, minor) + if GetPreviousVersion("0.7.1") != "0.6.0" { + t.Fatal() } - if major, minor := GetPreviousVersion("0.7111.1"); major != 0 || minor != 0 { - t.Fatal(major, minor) + if GetPreviousVersion("0.5.0") != "" { + t.Fatal() } } @@ -72,3 +80,31 @@ func TestIsCurrentVersion(t *testing.T) { t.Fatal() } } + +func TestIsPreviousVersionsSupported(t *testing.T) { + + // 1.4.0 CURRENT RELEASED VERSION + if !IsPreviousVersionsSupported(versions[0]) { + t.Fatal() + } + + // 1.3.0 + if !IsPreviousVersionsSupported(versions[1]) { + t.Fatal() + } + + // 1.2.1 + if !IsPreviousVersionsSupported(versions[2]) { + t.Fatal() + } + + // 1.2.0 + if !IsPreviousVersionsSupported(versions[3]) { + t.Fatal() + } + + // 1.1.0 NOT SUPPORTED + if IsPreviousVersionsSupported(versions[4]) { + t.Fatal() + } +} |