From e793dcde2a70c583289ceed622ab609154aed2e4 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 1 Jul 2020 13:44:09 +0200 Subject: [PATCH] Add a general loc test --- src/metrics/loc.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/metrics/loc.rs b/src/metrics/loc.rs index 2b0eda1df..b861588d1 100644 --- a/src/metrics/loc.rs +++ b/src/metrics/loc.rs @@ -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 + ] + ); + } }