in src/metrics/loc.rs [1407:1455]
fn cpp_block_comment_blank() {
// Checks that the blank metric is equal to 1 when there are
// block comments on independent lines.
check_metrics::<CppParser>(
"void ConnectToUpdateServer() {
int pool;
int updateServer = -42;
bool isConnected = false;
int currTry = 0;
/* Number of IPC connection retries
before
giving up. */
const int numRetries = 10;
const int numTries = 20; // Number of IPC connection tries before
// giving up.
}",
"foo.cpp",
|metric| {
// Spaces: 2
insta::assert_json_snapshot!(
metric.loc,
@r###"
{
"sloc": 13.0,
"ploc": 8.0,
"lloc": 6.0,
"cloc": 5.0,
"blank": 1.0,
"sloc_average": 6.5,
"ploc_average": 4.0,
"lloc_average": 3.0,
"cloc_average": 2.5,
"blank_average": 0.5,
"sloc_min": 13.0,
"sloc_max": 13.0,
"cloc_min": 5.0,
"cloc_max": 5.0,
"ploc_min": 8.0,
"ploc_max": 8.0,
"lloc_min": 6.0,
"lloc_max": 6.0,
"blank_min": 1.0,
"blank_max": 1.0
}"###
);
},
);
}