Skip to content

Commit

Permalink
Fix C# line counting and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardopirovano authored and Edoardo Pirovano committed Jun 23, 2021
1 parent d623a7a commit 68b6873
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 24 deletions.
6 changes: 6 additions & 0 deletions lib/count-loc.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/count-loc.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 4 additions & 13 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion node_modules/github-linguist/dist/languages.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/github-linguist/dist/languages.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/github-linguist/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion node_modules/github-linguist/src/languages.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"fast-deep-equal": "^3.1.3",
"file-url": "^3.0.0",
"fs": "0.0.1-security",
"github-linguist": "^2.4.2",
"github-linguist": "^2.4.3",
"glob": "^7.1.7",
"js-yaml": "^3.13.1",
"jsonschema": "1.2.6",
Expand Down
14 changes: 14 additions & 0 deletions src/count-loc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ test("ensure lines of code works for cpp and js", async (t) => {
});
});

test("ensure lines of code works for csharp", async (t) => {
const results = await countLoc(
path.join(__dirname, "../tests/multi-language-repo"),
[],
[],
[Language.csharp],
getRunnerLogger(true)
);

t.deepEqual(results, {
csharp: 10,
});
});

test("ensure lines of code can handle undefined language", async (t) => {
const results = await countLoc(
path.join(__dirname, "../tests/multi-language-repo"),
Expand Down

0 comments on commit 68b6873

Please sign in to comment.