Skip to content

Commit

Permalink
Add .codecov.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed May 24, 2024
1 parent 96043ae commit 462f07d
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
codecov:
require_ci_to_pass: false

ignore:
- benchmark/

coverage:
status:
project: # Overall project status
default:
target: auto
if_not_found: success
only_pulls: false
patch: # Status for the patch in pull requests
default:
target: auto
if_not_found: success
only_pulls: true
changes: false # Whether to comment on the coverage changes in pull requests

comment:
layout: "header, diff, files, footer"
behavior: default
require_changes: false
38 changes: 38 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,4 +708,42 @@ mod tests {
#[cfg(not(feature = "loom"))]
test_reset_on_put_in();
}

fn test_as_ref_in() {
let pool = create_pool(10);

let mut obj = pool.get();
obj.push(42);

{
let obj_ref = obj.as_ref();
assert_eq!(*obj_ref, [42]);
}

{
let obj_mut = obj.as_mut();
obj_mut.push(43);
}

let mut obj = pool.get_owned();
obj.push(42);
{
let obj_ref = obj.as_ref();
assert_eq!(*obj_ref, [42]);
}

{
let obj_mut = obj.as_mut();
obj_mut.push(43);
}
}

#[test]
fn test_as_ref() {
#[cfg(feature = "loom")]
loom::model(test_as_ref_in);

#[cfg(not(feature = "loom"))]
test_as_ref_in();
}
}

0 comments on commit 462f07d

Please sign in to comment.