@@ -8,17 +8,17 @@ import (
8
8
9
9
func TestParseAndValidate (t * testing.T ) {
10
10
res , err := ParseAndValidate ("" )
11
- if err != nil || res != FLAG_V1_0 {
11
+ if err != nil || res != Default {
12
12
t .Error ("It should be 1.1" )
13
13
}
14
14
15
15
res , err = ParseAndValidate ("1.1" )
16
- if err != nil || res != FLAG_V1_1 {
16
+ if err != nil || res != FlagSpecs [ 1 ] {
17
17
t .Error ("It should be 1.1" )
18
18
}
19
19
20
20
res , err = ParseAndValidate ("1.2" )
21
- if err != nil || res != FLAG_V1_2 {
21
+ if err != nil || res != FlagSpecs [ 2 ] {
22
22
t .Error ("It should be 1.2" )
23
23
}
24
24
@@ -28,34 +28,34 @@ func TestParseAndValidate(t *testing.T) {
28
28
}
29
29
}
30
30
31
- func TestsplitVersionFilter (t * testing.T ) {
31
+ func TestSplitVersionFilter (t * testing.T ) {
32
32
filter := NewSplitVersionFilter ()
33
- shouldFilter := filter .ShouldFilter (matchers .MatcherTypeBetweenSemver , FLAG_V1_0 )
33
+ shouldFilter := filter .ShouldFilter (matchers .MatcherTypeBetweenSemver , Default )
34
34
if ! shouldFilter {
35
35
t .Error ("It should filtered" )
36
36
}
37
37
38
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeEqualTo , FLAG_V1_0 )
38
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeEqualTo , Default )
39
39
if shouldFilter {
40
40
t .Error ("It should not filtered" )
41
41
}
42
42
43
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeBetweenSemver , FLAG_V1_1 )
43
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeBetweenSemver , FlagSpecs [ 1 ] )
44
44
if shouldFilter {
45
45
t .Error ("It should not filtered" )
46
46
}
47
47
48
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , FLAG_V1_0 )
48
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , Default )
49
49
if ! shouldFilter {
50
50
t .Error ("It should filtered" )
51
51
}
52
52
53
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , FLAG_V1_1 )
53
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , FlagSpecs [ 1 ] )
54
54
if ! shouldFilter {
55
55
t .Error ("It should filtered" )
56
56
}
57
57
58
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , FLAG_V1_2 )
58
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , FlagSpecs [ 2 ] )
59
59
if shouldFilter {
60
60
t .Error ("It should not filtered" )
61
61
}
0 commit comments