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

mbits-os / quick_dra / 22054814568

16 Feb 2026 08:08AM UTC coverage: 95.449% (+8.4%) from 87.008%
22054814568

Pull #39

github

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

50 of 54 new or added lines in 22 files covered. (92.59%)

5 existing lines in 4 files now uncovered.

4195 of 4395 relevant lines covered (95.45%)

1613.34 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(
30✔
15
            std::optional<std::string> const& arg) {
1✔
16
                if (!arg) {
31✔
17
                        return std::nullopt;
×
18
                }
19
                auto const m = ctre::match<
11✔
20
                    "^"
60✔
21
                    "([12][0-9]{3})-"
60✔
22
                    "([1-9]|0[0-9]|1[012])-"
60✔
23
                    "([1-9]|[012][0-9]|3[01])"
60✔
24
                    "$">(*arg);
90✔
25
                if (auto const& [whole, year_str, month_str, day_str] = m; whole) {
181✔
26
                        int year{};
91✔
27
                        int month{};
91✔
28
                        int day{};
91✔
29
                        if (!from_chars(year_str, year) || !from_chars(month_str, month) ||
101✔
30
                            !from_chars(day_str, day)) {
40✔
NEW
31
                                return std::nullopt;
×
32
                        }
33

60✔
34
                        return std::chrono::year{year} / month / day;
31✔
35
                }
60✔
36
                return std::nullopt;
37
        }
61✔
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