in src/metrics/loc.rs [1115:1159]
fn python_no_blank() {
// Checks that the blank metric is equal to 0 when there are no blank
// lines and there are 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": 9.0,
"ploc": 7.0,
"lloc": 6.0,
"cloc": 4.0,
"blank": 0.0,
"sloc_average": 4.5,
"ploc_average": 3.5,
"lloc_average": 3.0,
"cloc_average": 2.0,
"blank_average": 0.0,
"sloc_min": 9.0,
"sloc_max": 9.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": 0.0,
"blank_max": 0.0
}"###
);
},
);
}