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

Function testUpdateStatement

parser/parser_test.go:918–939  ·  view source on GitHub ↗
(t *testing.T, command ast.Command, expectedTableName string, expectedChanges map[token.Token]ast.Anonymitifier)

Source from the content-addressed store, hash-verified

916}
917
918func 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
941func whereStatementIsValid(t *testing.T, command ast.Command, expectedExpression ast.Expression) bool {
942 if command.TokenLiteral() != "WHERE" {

Callers 2

TestParseUpdateCommandFunction · 0.85

Calls 2

tokenMapEqualsFunction · 0.85
TokenLiteralMethod · 0.65

Tested by

no test coverage detected