• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbits-os / quick_dra / 22038263728

15 Feb 2026 03:31PM UTC coverage: 93.378% (+6.4%) from 87.008%
22038263728

Pull #39

github

web-flow
Merge 74a89bbd4 into 7d773e4d9
Pull Request #39: testing

58 of 67 new or added lines in 23 files covered. (86.57%)

75 existing lines in 12 files now uncovered.

4033 of 4319 relevant lines covered (93.38%)

1107.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/libs/cli/src/xml/ctre_parsing.cpp
1
// Copyright (c) 2026 midnightBITS
2
// This code is licensed under MIT license (see LICENSE for details)
3

4
#include "ctre_parsing.hpp"
5
#include <chrono>
6
#include <concepts>
7
#include <ctre.hpp>
8
#include <optional>
9
#include <quick_dra/base/types.hpp>
10
#include <string>
11
#include <string_view>
12

13
namespace quick_dra::builtin::xml {
14
        std::optional<std::chrono::year_month_day> parse_date(
21✔
15
            std::optional<std::string> const& arg) {
1✔
16
                if (!arg) {
22✔
17
                        return std::nullopt;
×
18
                }
19
                auto const m = ctre::match<
8✔
20
                    "^"
42✔
21
                    "([12][0-9]{3})-"
42✔
22
                    "([1-9]|0[0-9]|1[012])-"
42✔
23
                    "([1-9]|[012][0-9]|3[01])"
42✔
24
                    "$">(*arg);
63✔
25
                if (auto const& [whole, year_str, month_str, day_str] = m; whole) {
127✔
26
                        int year{};
64✔
27
                        int month{};
64✔
28
                        int day{};
64✔
29
                        if (!from_chars(year_str, year) || !from_chars(month_str, month) ||
71✔
30
                            !from_chars(day_str, day)) {
28✔
NEW
31
                                return std::nullopt;
×
32
                        }
33

42✔
34
                        return std::chrono::year{year} / month / day;
22✔
35
                }
42✔
36
                return std::nullopt;
37
        }
43✔
38
}  // namespace quick_dra::builtin::xml
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc