Skip to content

Commit bbc5e74

Browse files
committed
added indentation character check test
1 parent e0e2d44 commit bbc5e74

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package ;
2+
3+
import checkstyle.checks.IndentationCharacterCheck;
4+
5+
class IndentationCharacterCheckTest extends CheckTestCase {
6+
7+
public function testWrongIndentation() {
8+
var msg = checkMessage(IndentationTests.TEST1, new IndentationCharacterCheck());
9+
assertEquals(msg, 'Wrong indentation character (tab)');
10+
}
11+
12+
public function testCorrectIndentation() {
13+
var msg = checkMessage(IndentationTests.TEST2, new IndentationCharacterCheck());
14+
assertEquals(msg, '');
15+
}
16+
17+
public function testConfigurableIndentation() {
18+
var check = new IndentationCharacterCheck();
19+
check.character = "space";
20+
21+
var msg = checkMessage(IndentationTests.TEST3, check);
22+
assertEquals(msg, 'Wrong indentation character (space)');
23+
}
24+
}
25+
26+
class IndentationTests {
27+
public static inline var TEST1:String = "
28+
class Test {
29+
var _a:Int;
30+
public function new() {}
31+
}";
32+
33+
public static inline var TEST2:String =
34+
"class Test {
35+
var _a:Int;
36+
public function new() {}
37+
}";
38+
39+
public static inline var TEST3:String =
40+
"class Test {
41+
public function new() {}
42+
}";
43+
}

0 commit comments

Comments
 (0)