(t *testing.T, command ast.Command, expectedTableName string, expectedChanges map[token.Token]ast.Anonymitifier)
| 916 | } |
| 917 | |
| 918 | func testUpdateStatement(t *testing.T, command ast.Command, expectedTableName string, expectedChanges map[token.Token]ast.Anonymitifier) bool { |
| 919 | if command.TokenLiteral() != "UPDATE" { |
| 920 | t.Errorf("command.TokenLiteral() not 'UPDATE'. got=%q", command.TokenLiteral()) |
| 921 | return false |
| 922 | } |
| 923 | actualUpdateCommand, ok := command.(*ast.UpdateCommand) |
| 924 | |
| 925 | if !ok { |
| 926 | t.Errorf("actualUpdateCommand is not %T. got=%T", &ast.UpdateCommand{}, command) |
| 927 | return false |
| 928 | } |
| 929 | if actualUpdateCommand.Name.Token.Literal != expectedTableName { |
| 930 | t.Errorf("%s != %s", actualUpdateCommand.TokenLiteral(), expectedTableName) |
| 931 | return false |
| 932 | } |
| 933 | if !tokenMapEquals(actualUpdateCommand.Changes, expectedChanges) { |
| 934 | t.Errorf("") |
| 935 | return false |
| 936 | } |
| 937 | |
| 938 | return true |
| 939 | } |
| 940 | |
| 941 | func whereStatementIsValid(t *testing.T, command ast.Command, expectedExpression ast.Expression) bool { |
| 942 | if command.TokenLiteral() != "WHERE" { |
no test coverage detected