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

Alan-Jowett / ebpf-verifier / 18949625295

28 Oct 2025 10:33AM UTC coverage: 87.448% (-1.0%) from 88.47%
18949625295

push

github

elazarg
Bump CLI11 to v2.6.1

Signed-off-by: Elazar Gershuni <elazarg@gmail.com>

9022 of 10317 relevant lines covered (87.45%)

10783407.68 hits per line

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

84.21
/src/string_constraints.hpp
1
// Copyright (c) Prevail Verifier contributors.
2
// SPDX-License-Identifier: MIT
3

4
#pragma once
5

6
#include <optional>
7
#include <set>
8
#include <string>
9
#include <vector>
10

11
#include "arith/linear_constraint.hpp"
12
#include "crab/interval.hpp"
13

14
namespace prevail {
15
struct StringInvariant {
4,113✔
16
    std::optional<std::set<std::string>> maybe_inv{};
17

18
    StringInvariant() = default;
434✔
19

20
    explicit StringInvariant(std::set<std::string> inv) : maybe_inv(std::move(inv)) {}
255,982✔
21

22
    StringInvariant(const StringInvariant& inv) = default;
217,114✔
23
    StringInvariant& operator=(const StringInvariant& inv) = default;
120✔
24

25
    [[nodiscard]]
26
    bool is_bottom() const {
10,446✔
27
        return !maybe_inv;
10,446✔
28
    }
29
    [[nodiscard]]
30
    bool empty() const {
×
31
        return maybe_inv && maybe_inv->empty();
×
32
    }
33

34
    static StringInvariant top() { return StringInvariant{{}}; }
1,734✔
35
    static StringInvariant bottom() { return StringInvariant{}; }
434✔
36

37
    [[nodiscard]]
38
    const std::set<std::string>& value() const {
3,808✔
39
        if (is_bottom()) {
3,808✔
40
            throw std::runtime_error("cannot iterate bottom");
×
41
        }
42
        return *maybe_inv;
3,808✔
43
    }
44

45
    StringInvariant operator-(const StringInvariant& b) const;
46
    StringInvariant operator+(const StringInvariant& b) const;
47

48
    bool operator==(const StringInvariant& other) const { return maybe_inv == other.maybe_inv; }
2,088✔
49

50
    [[nodiscard]]
51
    bool contains(const std::string& item) const {
4,224✔
52
        return maybe_inv.value().contains(item);
4,224✔
53
    }
54

55
    friend std::ostream& operator<<(std::ostream&, const StringInvariant& inv);
56
};
57

58
struct TypeValueConstraints {
914✔
59
    std::vector<LinearConstraint> type_csts;
60
    std::vector<LinearConstraint> value_csts;
61
};
62

63
TypeValueConstraints parse_linear_constraints(const std::set<std::string>& constraints,
64
                                              std::vector<Interval>& numeric_ranges);
65
} // namespace prevail
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