Skip to content

Commit a13eb20

Browse files
committed
Added more tests
1 parent 7bfe336 commit a13eb20

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
@@ -99,6 +99,9 @@ func TestConstraintsParser(t *testing.T) {
9999
good := []goodStringTest{
100100
{"", ""}, // always true
101101
{"=1.3.0", "=1.3.0"},
102+
{"!=1.3.0", "!(=1.3.0)"},
103+
{" !=1.3.0", "!(=1.3.0)"},
104+
{"! =1.3.0", "!(=1.3.0)"},
102105
{"1.3.0", "^1.3.0"},
103106
{"!1.0.0", "!(^1.0.0)"},
104107
{" =1.3.0 ", "=1.3.0"},
@@ -143,6 +146,8 @@ func TestConstraintsParser(t *testing.T) {
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)"},
145148
{">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)"},
150+
{"!(>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
{"((>1.0.0) || (=2.0.0))", "(>1.0.0 || =2.0.0)"},
148153
}
@@ -159,6 +164,7 @@ func TestConstraintsParser(t *testing.T) {
159164

160165
bad := []string{
161166
"= 1.0.0",
167+
"!= 1.3.9",
162168
">= 1.0.0",
163169
"> 1.0.0",
164170
"<= 1.0.0",

0 commit comments

Comments
 (0)