(t *testing.T, command ast.Command, expectedExpression ast.Expression)
| 939 | } |
| 940 | |
| 941 | func 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 | |
| 961 | func stringArrayEquals(a []string, b []string) bool { |
| 962 | if len(a) != len(b) { |
no test coverage detected