in src/metrics/loc.rs [1067:1112]
fn python_no_zero_blank() {
// Checks that the blank metric is not equal to 0 when there are some
// comments next to code lines.
check_metrics::<PythonParser>(
"def ConnectToUpdateServer():
pool = 4
updateServer = -42
isConnected = False
currTry = 0
numRetries = 10 # Number of IPC connection retries before
# giving up.
numTries = 20 # Number of IPC connection tries before
# giving up.",
"foo.py",
|metric| {
// Spaces: 2
insta::assert_json_snapshot!(
metric.loc,
@r###"
{
"sloc": 10.0,
"ploc": 7.0,
"lloc": 6.0,
"cloc": 4.0,
"blank": 1.0,
"sloc_average": 5.0,
"ploc_average": 3.5,
"lloc_average": 3.0,
"cloc_average": 2.0,
"blank_average": 0.5,
"sloc_min": 10.0,
"sloc_max": 10.0,
"cloc_min": 4.0,
"cloc_max": 4.0,
"ploc_min": 7.0,
"ploc_max": 7.0,
"lloc_min": 6.0,
"lloc_max": 6.0,
"blank_min": 1.0,
"blank_max": 1.0
}"###
);
},
);
}