Skip to content

Commit

Permalink
ensure NaiveDateTime still works
Browse files Browse the repository at this point in the history
  • Loading branch information
Weakky committed Jun 3, 2024
1 parent ca723a5 commit df3699a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use tiberius::{IntoSql, Result, TokenRow};

#[cfg(all(feature = "tds73", feature = "chrono"))]
use chrono::DateTime;
#[cfg(all(feature = "tds73", feature = "chrono"))]
use chrono::NaiveDateTime;

use runtimes_macro::test_on_runtimes;

Expand Down Expand Up @@ -153,6 +155,14 @@ test_bulk_type!(datetime2(
vec![DateTime::from_timestamp(1658524194, 123456789); 100].into_iter()
));

#[cfg(all(feature = "tds73", feature = "chrono"))]
test_bulk_type!(datetime2_naive("DATETIME2", 100, {
#[allow(deprecated)]
let dt = NaiveDateTime::from_timestamp_opt(1658524194, 123456789).unwrap();

vec![dt; 100].into_iter()
}));

#[cfg(all(feature = "tds73", feature = "chrono"))]
test_bulk_type!(datetime2_0(
"DATETIME2(0)",
Expand Down

0 comments on commit df3699a

Please sign in to comment.