mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Fix casting of time points with non-system-clock duration with VS (#1748)
* Fix casting of time points with non-system-clock duration on Windows Add explicit `time_point_cast` to time point with duration of system clock. Fixes Visual Studio compile error. * Add test case for custom time points casting
This commit is contained in:
committed by
Wenzel Jakob
parent
ed39c50458
commit
b3bf248eec
@@ -99,3 +99,9 @@ def test_floating_point_duration():
|
||||
diff = m.test_chrono_float_diff(43.789012, 1.123456)
|
||||
assert diff.seconds == 42
|
||||
assert 665556 <= diff.microseconds <= 665557
|
||||
|
||||
|
||||
def test_nano_timepoint():
|
||||
time = datetime.datetime.now()
|
||||
time1 = m.test_nano_timepoint(time, datetime.timedelta(seconds=60))
|
||||
assert(time1 == time + datetime.timedelta(seconds=60))
|
||||
|
||||
Reference in New Issue
Block a user