File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments