Commit ce50f40 1 parent 86b3b0c commit ce50f40 Copy full SHA for ce50f40
File tree 5 files changed +6
-11
lines changed
bart-riers-sqlite-dataset
codeschool-sqlite-parser-test-files
5 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ impl<'a> Parser<'a> {
78
78
/// If the current token's type does not match, a [ParsingError::UnexpectedToken] is thrown.
79
79
fn consume_as_string ( & mut self ) -> Result < ( ) , ParsingError > {
80
80
let token = self . peek_token ( ) ?;
81
- dbg ! ( & token) ;
82
81
if let TokenType :: String ( _) = token. token_type {
83
82
self . consume_token ( ) ?;
84
83
Ok ( ( ) )
Original file line number Diff line number Diff line change 2
2
3
3
The test dataset is taken from the [ Bart Kiers' SQLite ANTLR parser] ( https://github.com/bkiers/sqlite-parser/tree/master ) .
4
4
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.
6
6
By passing tests, I mean that the parser successfully parses the SQL query and returns a valid ` Expression ` AST.
7
7
The structure of the parsed AST is not checked, as there are no expected ASTs list
8
8
Original file line number Diff line number Diff line change @@ -19,9 +19,8 @@ fn run_bart_riers_sqlite_dataset_test() {
19
19
let path = entry. path ( ) ;
20
20
21
21
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 {
25
24
passed_test += 1 ;
26
25
}
27
26
}
@@ -38,8 +37,6 @@ fn run_bart_riers_sqlite_dataset_test() {
38
37
"Passed {:.2}% of the tests" ,
39
38
( passed_test as f64 / total_tests as f64 ) * 100.0
40
39
) ;
41
-
42
- // assert_eq!(passed_test, total_tests);
43
40
}
44
41
45
42
/// Run a single test and return true if the test passes, false otherwise
Original file line number Diff line number Diff line change 3
3
The queries under ` sql/ ` folder are taken from the [ Codeschool SQLite Parser] ( https://github.com/codeschool/sqlite-parser/tree/master ) repository.
4
4
5
5
6
- Current test pass rate is 38.33 %
6
+ Current test pass rate is 37.74 %
Original file line number Diff line number Diff line change @@ -20,9 +20,8 @@ fn run_codeschool_sqlite_parser_test() {
20
20
21
21
if file. extension ( ) . and_then ( |ext| ext. to_str ( ) ) == Some ( "sql" ) {
22
22
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 {
26
25
passed_test += 1 ;
27
26
}
28
27
total_tests += 1 ;
You can’t perform that action at this time.
0 commit comments