Skip to content

Commit 26698b4

Browse files
committed
2025-01-10T17:51:27Z
1 parent fe93853 commit 26698b4

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed
File renamed without changes.
File renamed without changes.

omdev/cc/tests/src/ut.cc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//usr/bin/true; exec om cc run "$0" "$@"
2+
/* @omlish-cdeps [
3+
{
4+
"git": {
5+
"url": "https://github.com/boost-ext/ut",
6+
"rev": "f83e15c7f1edb49b4ec20f866eec06940d18a47d",
7+
"subtrees": [
8+
"include"
9+
]
10+
},
11+
"include": [
12+
"include"
13+
]
14+
}
15+
] */
16+
#include <boost/ut.hpp> // import boost.ut;
17+
18+
constexpr auto sum(auto... values) { return (values + ...); }
19+
20+
int main() {
21+
using namespace boost::ut;
22+
23+
"sum"_test = [] {
24+
expect(sum(0) == 0_i);
25+
expect(sum(1, 2) == 3_i);
26+
expect(sum(1, 2) > 0_i and 41_i == sum(40, 2));
27+
};
28+
}

omdev/cc/tests/test_cc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _compile_and_run(
4545
def test_hi(tmpdir):
4646
out = _compile_and_run(
4747
str(tmpdir),
48-
os.path.join(os.path.dirname(__file__), 'hi.cc'),
48+
os.path.join(os.path.dirname(__file__), 'src/hi.cc'),
4949
'foo bar',
5050
'baz',
5151
)
@@ -62,7 +62,7 @@ def test_hi(tmpdir):
6262
def test_json(tmpdir):
6363
out = _compile_and_run(
6464
str(tmpdir),
65-
os.path.join(os.path.dirname(__file__), 'json.cc'),
65+
os.path.join(os.path.dirname(__file__), 'src/json.cc'),
6666
)
6767

6868
assert out.decode().strip() == (

0 commit comments

Comments
 (0)