@@ -26,8 +26,8 @@ use tempfile::tempdir;
26
26
27
27
type Result = std:: result:: Result < ( ) , Box < dyn std:: error:: Error > > ;
28
28
29
- #[ test]
30
- fn test_oracle ( ) {
29
+ #[ tokio :: test]
30
+ async fn test_oracle ( ) {
31
31
let manifest_path: & Path = env ! ( "CARGO_MANIFEST_DIR" ) . as_ref ( ) ;
32
32
let test_samples_path = manifest_path. join ( "tests/assets/fixtures" ) ;
33
33
@@ -41,12 +41,12 @@ fn test_oracle() {
41
41
}
42
42
}
43
43
if entry. file_type ( ) . is_file ( ) {
44
- run_test_sample ( entry. path ( ) ) . unwrap ( ) ;
44
+ run_test_sample ( entry. path ( ) ) . await . unwrap ( ) ;
45
45
}
46
46
}
47
47
}
48
48
49
- fn run_test_sample ( path : & Path ) -> Result {
49
+ async fn run_test_sample ( path : & Path ) -> Result {
50
50
println ! ( "test: {:?}" , path. file_name( ) . unwrap( ) ) ;
51
51
let curdir = std:: env:: current_dir ( ) . unwrap ( ) ;
52
52
let tmp = tempdir ( ) ?;
@@ -123,14 +123,8 @@ fn run_test_sample(path: &Path) -> Result {
123
123
drop ( libsql_conn) ;
124
124
125
125
let shared = registry. clone ( ) . open ( & db_path, & "test" . into ( ) ) . unwrap ( ) ;
126
- let rt = tokio:: runtime:: Builder :: new_current_thread ( )
127
- . enable_all ( )
128
- . build ( )
129
- . unwrap ( ) ;
130
126
seal_current_segment ( & shared) ;
131
- rt. block_on ( async {
132
- shared. checkpoint ( ) . await . unwrap ( ) ;
133
- } ) ;
127
+ shared. checkpoint ( ) . await . unwrap ( ) ;
134
128
135
129
std:: env:: set_current_dir ( curdir) . unwrap ( ) ;
136
130
match std:: panic:: catch_unwind ( || {
@@ -168,9 +162,9 @@ impl Display for PrintScript {
168
162
}
169
163
}
170
164
171
- fn compare_db_files ( db1 : & Path , db2 : & Path ) {
172
- let db1 = std:: fs:: File :: open ( db1 ) . unwrap ( ) ;
173
- let db2 = std:: fs:: File :: open ( db2 ) . unwrap ( ) ;
165
+ fn compare_db_files ( sqlite : & Path , libsql : & Path ) {
166
+ let db1 = std:: fs:: File :: open ( sqlite ) . unwrap ( ) ;
167
+ let db2 = std:: fs:: File :: open ( libsql ) . unwrap ( ) ;
174
168
175
169
let len1 = db1. metadata ( ) . unwrap ( ) . len ( ) ;
176
170
let len2 = db2. metadata ( ) . unwrap ( ) . len ( ) ;
0 commit comments