From 61a7620da35c0773a4407b7890baa8a1868c70fa Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 5 Jul 2024 23:12:31 +0300 Subject: Add disabled test for butl::optional use case described in libstud-optional GH issue #1 --- tests/optional/driver.cxx | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/optional/driver.cxx b/tests/optional/driver.cxx index da09cf5..63254b5 100644 --- a/tests/optional/driver.cxx +++ b/tests/optional/driver.cxx @@ -2,7 +2,8 @@ // license : MIT; see accompanying LICENSE file #include -#include // move() +#include +#include // move(), pair #include @@ -27,7 +28,24 @@ main () { using butl::optional; - optional r; - vector> rs; - rs.emplace_back (move (r)); + { + optional r; + vector> rs; + rs.emplace_back (move (r)); + } + + // See https://github.com/libstud/libstud-optional/issues/1 for details. + // +#if 0 + { + vector>> options; + auto add = [&options] (string o, optional v = {}) + { + options.emplace_back (move (o), move (v)); + }; + + add ("-usb"); + add ("-device", "usb-kbd"); + } +#endif } -- cgit v1.1