working on negative Tests

This commit is contained in:
JonathanFleischmann 2024-06-29 17:13:30 +02:00
parent fc28ec5f12
commit cd8cff9a0e
4 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import de.maishai.Compiler;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
public class NegativeTests {
@Test
public void AddressingFieldWithoutThis() {
try {
Compiler.generateByteCodeFilesFromFiles(List.of("src/test/testFiles/Negative/AddressingFieldWithoutThis.java"));
Assertions.fail();
} catch (Exception e) {
Assertions.assertTrue(true);
}
}
@Test
public void PublicMissingInClass() {
Compiler.generateByteCodeFilesFromFiles(List.of("src/test/testFiles/Negative/PublicMissingInClass.java"));
}
}

View File

@ -0,0 +1,6 @@
public class AddressingFieldWithoutThis {
int x;
public AddressingFieldWithoutThis() {
x = 5;
}
}

Binary file not shown.

View File

@ -0,0 +1,2 @@
class PublicMissingInClass {
}