File: version_test.go

package info (click to toggle)
receptor 1.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,772 kB
  • sloc: python: 1,643; makefile: 305; sh: 174
file content (37 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package version

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestValidateVersion(t *testing.T) {
	type test struct {
		name     string
		input    string
		expected string
	}

	for _, tt := range []*test{
		{
			name:     "version is empty string",
			input:    "",
			expected: "Version unknown",
		},
		{
			name:     "version is zero",
			input:    "0",
			expected: "0",
		},
		{
			name:     "version is one",
			input:    "1",
			expected: "1",
		},
	} {
		Version = tt.input
		output := validateVersion()
		assert.Equal(t, tt.expected, output)
	}
}