Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix C# line counting and add test
  • Loading branch information
edoardopirovano authored and Edoardo Pirovano committed Jun 23, 2021
commit 68b68732c6c383c283d44d67b0e0df53d12d164d
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