mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 13:58:55 +08:00 
			
		
		
		
	Fix tests and improve InvalidColumnType error message.
This commit is contained in:
		| @@ -267,7 +267,8 @@ mod test { | ||||
|                                     WHERE v1.rowid < v2.rowid") | ||||
|                           .unwrap(); | ||||
|  | ||||
|             let row = s.query(&[]).unwrap().next().unwrap().unwrap(); | ||||
|             let mut rows = s.query(&[]).unwrap(); | ||||
|             let row = rows.next().unwrap().unwrap(); | ||||
|             assert_eq!(row.get::<i32, i32>(0), 2); | ||||
|         } | ||||
|         db.execute_batch("DROP TABLE vtab").unwrap(); | ||||
|   | ||||
| @@ -173,7 +173,6 @@ mod test { | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         s.reset_if_needed(); | ||||
|         p1.borrow_mut().clear(); | ||||
|         p2.borrow_mut().clear(); | ||||
|         p3.borrow_mut().clear(); | ||||
| @@ -182,18 +181,19 @@ mod test { | ||||
|         p3.borrow_mut().append(&mut vec![-5, -10]); | ||||
|  | ||||
|         { | ||||
|             let row = s.query(&[]).unwrap().next().unwrap().unwrap(); | ||||
|             let mut rows = s.query(&[]).unwrap(); | ||||
|             let row = rows.next().unwrap().unwrap(); | ||||
|             assert_eq!(1, row.get(0)); | ||||
|             assert_eq!(11, row.get(1)); | ||||
|             assert_eq!(-5, row.get(2)); | ||||
|         } | ||||
|  | ||||
|         s.reset_if_needed(); | ||||
|         p2.borrow_mut().clear(); | ||||
|         p3.borrow_mut().clear(); | ||||
|         p2.borrow_mut().append(&mut vec![3, 4, 5]); | ||||
|         p3.borrow_mut().append(&mut vec![0, -5]); | ||||
|         assert!(s.query(&[]).unwrap().next().is_none()); | ||||
|         let mut rows = s.query(&[]).unwrap(); | ||||
|         assert!(rows.next().is_none()); | ||||
|  | ||||
|         int_array::drop_int_array(&db, "ex1").unwrap(); | ||||
|         int_array::drop_int_array(&db, "ex2").unwrap(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user