Skip to content

Commit e0e2d44

Browse files
committed
added hexadecimals check test
1 parent 53b01e3 commit e0e2d44

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package ;
2+
3+
import checkstyle.checks.HexadecimalLiteralsCheck;
4+
5+
class HexadecimalLiteralsCheckTest extends CheckTestCase {
6+
7+
public function testCorrectOverride() {
8+
var msg = checkMessage(HexadecimalTests.TEST1, new HexadecimalLiteralsCheck());
9+
assertEquals(msg, 'Bad hexademical literal, use uppercase');
10+
}
11+
12+
public function testWrongOverride() {
13+
var msg = checkMessage(HexadecimalTests.TEST2, new HexadecimalLiteralsCheck());
14+
assertEquals(msg, '');
15+
}
16+
}
17+
18+
class HexadecimalTests {
19+
public static inline var TEST1:String = "
20+
class Test {
21+
var _clr = 0xffffff;
22+
}";
23+
24+
public static inline var TEST2:String =
25+
"class Test {
26+
var _clr = 0x0033FF;
27+
}";
28+
}

0 commit comments

Comments
 (0)