Skip to content

Fix test-util fn all_dialects() to test all dialects actually #690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
unvalley opened this issue Oct 26, 2022 · 0 comments · Fixed by #697
Closed

Fix test-util fn all_dialects() to test all dialects actually #690

unvalley opened this issue Oct 26, 2022 · 0 comments · Fixed by #697

Comments

@unvalley
Copy link
Contributor

unvalley commented Oct 26, 2022

This is for internal but some fixes may be for users.

In tests/sqlparser_common.rs (⚠️ linked page may freeze your browser), a lot of test cases depend on fn all_dialects() to test all dialects.
But this fn all_dialects() doesn't include MySqlDialect and BigQueryDialect currently.
So we should include those to all_dialects and fix failed test cases after changing.

Change all_dialects to add MySqlDialect and BigQueryDialect (src/test_utils.rs):

pub fn all_dialects() -> TestedDialects {
    TestedDialects {
        dialects: vec![
            Box::new(GenericDialect {}),
            Box::new(PostgreSqlDialect {}),
            Box::new(MsSqlDialect {}),
            Box::new(AnsiDialect {}),
            Box::new(SnowflakeDialect {}),
            Box::new(HiveDialect {}),
            Box::new(RedshiftSqlDialect {}),
            Box::new(MySqlDialect {}), // Added
            Box::new(BigQueryDialect {}), // Added
        ],
    }
}

Test results after changing above:

failures:
    parse_at_timezone
    parse_collate
    parse_collate_after_parens
    parse_delete_statement
    parse_delimited_identifiers
    parse_like
    parse_similar_to

test result: FAILED. 187 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s

error: test failed, to rerun pass '--test sqlparser_common'
@unvalley unvalley changed the title Fix test util fn all_dialects() to test all dialects actually Fix testutil fn all_dialects() to test all dialects actually Oct 26, 2022
@unvalley unvalley changed the title Fix testutil fn all_dialects() to test all dialects actually Fix test-util fn all_dialects() to test all dialects actually Oct 26, 2022
@alamb alamb closed this as completed in #697 Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant