Skip to content

Commit cb61353

Browse files
committed
Added more tests
1 parent 4dc6137 commit cb61353

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

constraints_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ func TestConstraintsParser(t *testing.T) {
9898
good := []goodStringTest{
9999
{"", ""}, // always true
100100
{"=1.3.0", "=1.3.0"},
101+
{"!=1.3.0", "!(=1.3.0)"},
102+
{" !=1.3.0", "!(=1.3.0)"},
103+
{"! =1.3.0", "!(=1.3.0)"},
101104
{"1.3.0", "^1.3.0"},
102105
{"!1.0.0", "!(^1.0.0)"},
103106
{" =1.3.0 ", "=1.3.0"},
@@ -142,6 +145,8 @@ func TestConstraintsParser(t *testing.T) {
142145
{"(>1.0.0) || =2.0.0", "(>1.0.0 || =2.0.0)"},
143146
{">1.0.0 || (2.0.0)", "(>1.0.0 || ^2.0.0)"},
144147
{">1.0.0 || (=2.0.0)", "(>1.0.0 || =2.0.0)"},
148+
{"!>1.0.0 || (=2.0.0)", "(!(>1.0.0) || =2.0.0)"},
149+
{"!(>1.0.0 || =2.0.0)", "!(>1.0.0 || =2.0.0)"},
145150
{"((>1.0.0) || (2.0.0))", "(>1.0.0 || ^2.0.0)"},
146151
{"((>1.0.0) || (=2.0.0))", "(>1.0.0 || =2.0.0)"},
147152
}
@@ -158,6 +163,7 @@ func TestConstraintsParser(t *testing.T) {
158163

159164
bad := []string{
160165
"= 1.0.0",
166+
"!= 1.3.9",
161167
">= 1.0.0",
162168
"> 1.0.0",
163169
"<= 1.0.0",

0 commit comments

Comments
 (0)