MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / testJoinCommands

Function testJoinCommands

parser/parser_test.go:1066–1080  ·  view source on GitHub ↗
(t *testing.T, expectedJoinCommand ast.JoinCommand, actualJoinCommand ast.JoinCommand)

Source from the content-addressed store, hash-verified

1064}
1065
1066func testJoinCommands(t *testing.T, expectedJoinCommand ast.JoinCommand, actualJoinCommand ast.JoinCommand) {
1067
1068 if expectedJoinCommand.Token.Type != actualJoinCommand.Token.Type {
1069 t.Errorf("Expecting Token TokenType: %q, got: %q", expectedJoinCommand.Token.Type, actualJoinCommand.Token.Type)
1070 }
1071 if expectedJoinCommand.Token.Literal != actualJoinCommand.Token.Literal {
1072 t.Errorf("Expecting Token Literal: %s, got: %s", expectedJoinCommand.Token.Literal, actualJoinCommand.Token.Literal)
1073 }
1074 if expectedJoinCommand.Name != actualJoinCommand.Name {
1075 t.Errorf("Expecting Name to has a value: %s, got: %s", expectedJoinCommand.Name, actualJoinCommand.Name)
1076 }
1077 if !expressionsAreEqual(actualJoinCommand.Expression, expectedJoinCommand.Expression) {
1078 t.Errorf("Actual expression is not equal to expected one.\nActual: %#v\nExpected: %#v", actualJoinCommand.Expression, expectedJoinCommand.Expression)
1079 }
1080}
1081func expressionsAreEqual(first ast.Expression, second ast.Expression) bool {
1082
1083 booleanExpression, booleanExpressionIsValid := first.(*ast.BooleanExpression)

Calls 1

expressionsAreEqualFunction · 0.85

Tested by

no test coverage detected