Skip to content

Commit ce50f40

Browse files
committed
sql-parser: minor test updates on test-dataset
1 parent 86b3b0c commit ce50f40

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

src/parser/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ impl<'a> Parser<'a> {
7878
/// If the current token's type does not match, a [ParsingError::UnexpectedToken] is thrown.
7979
fn consume_as_string(&mut self) -> Result<(), ParsingError> {
8080
let token = self.peek_token()?;
81-
dbg!(&token);
8281
if let TokenType::String(_) = token.token_type {
8382
self.consume_token()?;
8483
Ok(())

tests/bart-riers-sqlite-dataset/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The test dataset is taken from the [Bart Kiers' SQLite ANTLR parser](https://github.com/bkiers/sqlite-parser/tree/master).
44

5-
In the current implementation, there is 65.33% of the tests that are passing.
5+
In the current implementation, there is 61.86% of the tests that are passing.
66
By passing tests, I mean that the parser successfully parses the SQL query and returns a valid `Expression` AST.
77
The structure of the parsed AST is not checked, as there are no expected ASTs list
88

tests/bart-riers-sqlite-dataset/main.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ fn run_bart_riers_sqlite_dataset_test() {
1919
let path = entry.path();
2020

2121
if path.extension().and_then(|ext| ext.to_str()) == Some("sql") {
22-
let parsing_result = std::panic::catch_unwind(|| run_test(&path));
23-
24-
if parsing_result.is_ok() && parsing_result.unwrap() {
22+
let parsing_result = run_test(&path);
23+
if parsing_result {
2524
passed_test += 1;
2625
}
2726
}
@@ -38,8 +37,6 @@ fn run_bart_riers_sqlite_dataset_test() {
3837
"Passed {:.2}% of the tests",
3938
(passed_test as f64 / total_tests as f64) * 100.0
4039
);
41-
42-
// assert_eq!(passed_test, total_tests);
4340
}
4441

4542
/// Run a single test and return true if the test passes, false otherwise

tests/codeschool-sqlite-parser-test-files/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
The queries under `sql/` folder are taken from the [Codeschool SQLite Parser](https://github.com/codeschool/sqlite-parser/tree/master) repository.
44

55

6-
Current test pass rate is 38.33%
6+
Current test pass rate is 37.74%

tests/codeschool-sqlite-parser-test-files/main.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ fn run_codeschool_sqlite_parser_test() {
2020

2121
if file.extension().and_then(|ext| ext.to_str()) == Some("sql") {
2222
let sql_content = fs::read_to_string(file).expect("Failed to read file");
23-
let parsing_result = std::panic::catch_unwind(|| run_test(&sql_content));
24-
25-
if parsing_result.is_ok() && parsing_result.unwrap() {
23+
let parsing_result = run_test(&sql_content);
24+
if parsing_result {
2625
passed_test += 1;
2726
}
2827
total_tests += 1;

0 commit comments

Comments
 (0)