MCPcopy Index your code
hub / github.com/LissaGreense/GO4SQL / whereStatementIsValid

Function whereStatementIsValid

parser/parser_test.go:941–959  ·  view source on GitHub ↗
(t *testing.T, command ast.Command, expectedExpression ast.Expression)

Source from the content-addressed store, hash-verified

939}
940
941func whereStatementIsValid(t *testing.T, command ast.Command, expectedExpression ast.Expression) bool {
942 if command.TokenLiteral() != "WHERE" {
943 t.Errorf("command.TokenLiteral() not 'WHERE'. got=%q", command.TokenLiteral())
944 return false
945 }
946
947 actualWhereCommand, ok := command.(*ast.WhereCommand)
948 if !ok {
949 t.Errorf("actualWhereCommand is not %T. got=%T", &ast.WhereCommand{}, command)
950 return false
951 }
952
953 if !expressionsAreEqual(actualWhereCommand.Expression, expectedExpression) {
954 t.Errorf("Actual expression is not equal to expected one.\nActual: %#v\nExpected: %#v", actualWhereCommand.Expression, expectedExpression)
955 return false
956 }
957
958 return true
959}
960
961func stringArrayEquals(a []string, b []string) bool {
962 if len(a) != len(b) {

Callers 4

TestParseWhereCommandFunction · 0.85
TestParseDeleteCommandFunction · 0.85

Calls 2

expressionsAreEqualFunction · 0.85
TokenLiteralMethod · 0.65

Tested by

no test coverage detected