summaryrefslogtreecommitdiff
path: root/ext/pybind11/tests/test_chrono.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pybind11/tests/test_chrono.cpp')
-rw-r--r--ext/pybind11/tests/test_chrono.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/pybind11/tests/test_chrono.cpp b/ext/pybind11/tests/test_chrono.cpp
index b86f57adf..fcc1b6185 100644
--- a/ext/pybind11/tests/test_chrono.cpp
+++ b/ext/pybind11/tests/test_chrono.cpp
@@ -48,6 +48,11 @@ std::chrono::microseconds test_chrono7(std::chrono::microseconds t) {
return t;
}
+// Float durations (issue #719)
+std::chrono::duration<double> test_chrono_float_diff(std::chrono::duration<float> a, std::chrono::duration<float> b) {
+ return a - b;
+}
+
test_initializer chrono([] (py::module &m) {
m.def("test_chrono1", &test_chrono1);
m.def("test_chrono2", &test_chrono2);
@@ -56,4 +61,5 @@ test_initializer chrono([] (py::module &m) {
m.def("test_chrono5", &test_chrono5);
m.def("test_chrono6", &test_chrono6);
m.def("test_chrono7", &test_chrono7);
+ m.def("test_chrono_float_diff", &test_chrono_float_diff);
});