This commit is contained in:
E. Lynette Rayle 2023-02-08 17:49:58 -05:00
Родитель 9e28f22555
Коммит 3d115ff280
1 изменённых файлов: 0 добавлений и 20 удалений

Просмотреть файл

@ -1084,12 +1084,6 @@ func TestParseTokens(t *testing.T) {
{"operator error - missing operator", getMissingOperatorTokens(0),
&node{}, "", errors.New("licenses or expressions are not separated by an operator"),
},
{"operator error - missing license after OR", getMissingSecondLicenseInORTokens(0),
&node{}, "", errors.New("expected expression following OR, but found none"),
},
{"operator error - missing license after AND", getMissingSecondLicenseInANDTokens(0),
&node{}, "", errors.New("expected expression following AND, but found none"),
},
{"operator error - starts with close parenthesis", getStartsWithCloseParenTokens(0),
&node{}, "", errors.New("expression starts with close parenthesis"),
},
@ -1371,20 +1365,6 @@ func getMissingOperatorTokens(index int) *tokenStream {
return getTokenStream(tokens, index)
}
func getMissingSecondLicenseInORTokens(index int) *tokenStream {
var tokens []token
tokens = append(tokens, token{role: licenseToken, value: "MIT"})
tokens = append(tokens, token{role: operatorToken, value: "OR"})
return getTokenStream(tokens, index)
}
func getMissingSecondLicenseInANDTokens(index int) *tokenStream {
var tokens []token
tokens = append(tokens, token{role: licenseToken, value: "MIT"})
tokens = append(tokens, token{role: operatorToken, value: "AND"})
return getTokenStream(tokens, index)
}
func getStartsWithCloseParenTokens(index int) *tokenStream {
var tokens []token
tokens = append(tokens, token{role: operatorToken, value: ")"})