Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 233119e

Browse files
committed
Remove redundant import and add addtional test
1 parent ed6cdb6 commit 233119e

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

src/main/java/com/searchcode/app/util/SlocCounter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package com.searchcode.app.util;
1212

13-
import com.searchcode.app.dto.CodeIndexDocument;
1413
import com.searchcode.app.dto.FileClassifierResult;
1514
import com.searchcode.app.service.Singleton;
1615

src/test/java/com/searchcode/app/util/SlocCounterTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,36 @@ public void testCPlusPlus() {
118118
assertThat(slocCount.blankCount).isEqualTo(4);
119119
}
120120

121+
public void testRuby() {
122+
String language = "Ruby";
123+
String contents = "# 20 lines 9 code 8 comments 3 blanks\n" +
124+
"x = 3\n" +
125+
"if x < 2\n" +
126+
" p = \"Smaller\"\n" +
127+
"else\n" +
128+
" p = \"Bigger\"\n" +
129+
"end\n" +
130+
"\n" +
131+
"=begin\n" +
132+
" Comments\n" +
133+
" Comments\n" +
134+
" Comments\n" +
135+
" Comments\n" +
136+
"=end\n" +
137+
"\n" +
138+
"# testing.\n" +
139+
"while x > 2 and x < 10\n" +
140+
" x += 1\n" +
141+
"end\n" +
142+
"\n";
143+
144+
SlocCounter.SlocCount slocCount = this.slocCounter.countStats(contents, language);
145+
assertThat(slocCount.linesCount).isEqualTo(20);
146+
assertThat(slocCount.codeCount).isEqualTo(9);
147+
assertThat(slocCount.commentCount).isEqualTo(8);
148+
assertThat(slocCount.blankCount).isEqualTo(3);
149+
}
150+
121151
public void testTokeiTest() {
122152
String language = "Rust";
123153
String contents = "// 39 lines 32 code 2 comments 5 blanks\n" +

0 commit comments

Comments
 (0)