Skip to content

Commit 200371a

Browse files
committed
improved tests
1 parent c465b24 commit 200371a

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

jbbp/src/test/java/com/igormaznitsa/jbbp/compiler/JBBPCompilerTest.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,17 +608,36 @@ public void testCompile_FixedStructArray() throws Exception {
608608
}
609609

610610
@Test
611-
public void testCompile_ErrorForNamedReset() throws Exception {
611+
public void testCompile_correctFieldName() throws Exception {
612+
JBBPCompiler.compile("int a;int _a;int a11;int a_f;int a_1;");
612613
assertThrows(JBBPCompilationException.class, new Executable() {
613614
@Override
614615
public void execute() throws Throwable {
615-
JBBPCompiler.compile("reset$$ hello;");
616+
JBBPCompiler.compile("int 1a;");
616617
}
617618
});
618619
}
619620

620621
@Test
621-
public void testCompile_ErrorForArrayReset() throws Exception {
622+
public void testCompile_ErrorForNonAllowedArguments() throws Exception {
623+
assertThrows(JBBPCompilationException.class, new Executable() {
624+
@Override
625+
public void execute() throws Throwable {
626+
JBBPCompiler.compile("reset$$:1;");
627+
}
628+
});
629+
assertThrows(JBBPCompilationException.class, new Executable() {
630+
@Override
631+
public void execute() throws Throwable {
632+
JBBPCompiler.compile("reset$$ hello;");
633+
}
634+
});
635+
assertThrows(JBBPCompilationException.class, new Executable() {
636+
@Override
637+
public void execute() throws Throwable {
638+
JBBPCompiler.compile("reset$$ [445];");
639+
}
640+
});
622641
assertThrows(JBBPCompilationException.class, new Executable() {
623642
@Override
624643
public void execute() throws Throwable {

0 commit comments

Comments
 (0)