diff options
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -354,7 +354,7 @@ impl Column { } /// Type of plain integers that can be stored. -pub type DbInt = u64; +pub type DbInt = i64; /// A value in a named column. #[derive(Debug)] @@ -631,4 +631,17 @@ mod test { } assert_eq!(values, expected); } + + #[test] + fn round_trips_int_max() { + let tmp = tempdir().unwrap(); + let filename = tmp.path().join("test.db"); + let mut db = create_db(&filename); + insert(&mut db, DbInt::MAX); + db.close().unwrap(); + + let db = open_db(&filename); + let values = values(db); + assert_eq!(values, vec![DbInt::MAX]); + } } |