-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit-id:f6098cdc
- Loading branch information
Showing
9 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
crates/cairo-coverage/tests/data/coverage_ignore/Scarb.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "coverage_ignore" | ||
version = "0.1.0" | ||
edition = "2024_07" | ||
|
||
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html | ||
[dependencies] | ||
starknet = ">=2.8.0" | ||
|
||
[dev-dependencies] | ||
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.29.0" } | ||
|
||
[[target.starknet-contract]] | ||
sierra = true | ||
|
||
[scripts] | ||
test = "snforge test" | ||
|
||
[profile.dev.cairo] | ||
unstable-add-statements-functions-debug-info = true | ||
unstable-add-statements-code-locations-debug-info = true | ||
inlining-strategy= "avoid" |
2 changes: 2 additions & 0 deletions
2
crates/cairo-coverage/tests/data/coverage_ignore/src/lib.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod simple; | ||
mod multiply; |
13 changes: 13 additions & 0 deletions
13
crates/cairo-coverage/tests/data/coverage_ignore/src/multiply.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pub fn multiply(a: i32, b: i32) -> i32 { | ||
a * b | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::multiply; | ||
|
||
#[test] | ||
fn it_works() { | ||
assert(multiply(2, 1) == 2, ''); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
crates/cairo-coverage/tests/data/coverage_ignore/src/simple.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod add; | ||
mod subtract; |
15 changes: 15 additions & 0 deletions
15
crates/cairo-coverage/tests/data/coverage_ignore/src/simple/add.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pub fn add(a: i32, b: i32) -> i32 { | ||
a + b | ||
} | ||
|
||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::add; | ||
|
||
#[test] | ||
fn it_works() { | ||
assert(add(1, 2) == 3, ''); | ||
} | ||
} | ||
|
14 changes: 14 additions & 0 deletions
14
crates/cairo-coverage/tests/data/coverage_ignore/src/simple/subtract.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub fn subtract(a: i32, b: i32) -> i32 { | ||
a - b | ||
} | ||
|
||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::subtract; | ||
|
||
#[test] | ||
fn it_works() { | ||
assert(subtract(2, 1) == 1, ''); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
crates/cairo-coverage/tests/expected_output/coverage_ignore_dir.lcov
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
TN: | ||
SF:{dir}/src/multiply.cairo | ||
FN:2,coverage_ignore::multiply::multiply | ||
FNDA:1,coverage_ignore::multiply::multiply | ||
FNF:1 | ||
FNH:1 | ||
DA:2,1 | ||
LF:1 | ||
LH:1 | ||
end_of_record |
10 changes: 10 additions & 0 deletions
10
crates/cairo-coverage/tests/expected_output/coverage_ignore_file.lcov
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
TN: | ||
SF:{dir}/src/simple/subtract.cairo | ||
FN:2,coverage_ignore::simple::subtract::subtract | ||
FNDA:1,coverage_ignore::simple::subtract::subtract | ||
FNF:1 | ||
FNH:1 | ||
DA:2,1 | ||
LF:1 | ||
LH:1 | ||
end_of_record |