Skip to content

Commit

Permalink
Add a general loc test (mozilla#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 authored and spacedragon committed Feb 2, 2021
1 parent b2ec2c6 commit 6f60f2c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/metrics/loc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,26 @@ mod tests {
[(lloc, 2, usize)]
);
}

#[test]
fn test_general_loc() {
check_metrics!(
"def func(a,
b,
c):
print(a)
print(b)
print(c)",
"foo.py",
PythonParser,
loc,
[
(sloc, 6, usize), // The number of lines is 6
(ploc, 6, usize), // The number of code lines is 6
(lloc, 3, usize), // The number of statements is 3 (print)
(cloc, 0, usize), // The number of comments is 0
(blank, 0, usize) // The number of blank lines is 0
]
);
}
}

0 comments on commit 6f60f2c

Please sign in to comment.