Skip to content

Commit 3721582

Browse files
konardclaude
andcommitted
Add 100% test coverage for Rust code and CI workflow
- Add comprehensive unit tests for all traits: - Num trait: tested for all primitive integer types - SignNum trait: tested for all signed integer types - ToSigned trait: tested conversions for all integer types including edge cases - MaxValue trait: tested for all integer types - LinkType trait: tested for all unsigned integer types - Add integration tests for combined trait usage - Add edge case tests for unsigned-to-signed conversion wrapping behavior - Add GitHub Actions workflow for Rust testing and coverage Test coverage: 100% (67 tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e30ffa5 commit 3721582

File tree

2 files changed

+561
-7
lines changed

2 files changed

+561
-7
lines changed

.github/workflows/rust.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- 'rust/**'
9+
- '.github/workflows/rust.yml'
10+
pull_request:
11+
branches:
12+
- 'main'
13+
paths:
14+
- 'rust/**'
15+
- '.github/workflows/rust.yml'
16+
17+
defaults:
18+
run:
19+
working-directory: rust
20+
21+
jobs:
22+
test:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install Rust toolchain
28+
uses: dtolnay/rust-toolchain@master
29+
with:
30+
toolchain: nightly-2022-08-22
31+
components: rustfmt
32+
33+
- name: Run tests
34+
run: cargo test --verbose
35+
36+
- name: Check formatting
37+
run: cargo fmt -- --check
38+
39+
coverage:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Install Rust toolchain
45+
uses: dtolnay/rust-toolchain@master
46+
with:
47+
toolchain: nightly-2022-08-22
48+
components: llvm-tools-preview
49+
50+
- name: Install cargo-llvm-cov
51+
uses: taiki-e/install-action@cargo-llvm-cov
52+
53+
- name: Generate code coverage
54+
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
55+
56+
- name: Upload coverage to Codecov
57+
uses: codecov/codecov-action@v4
58+
with:
59+
files: rust/lcov.info
60+
fail_ci_if_error: false

0 commit comments

Comments
 (0)