mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 16:48:03 +00:00
working on negative Tests
This commit is contained in:
parent
fc28ec5f12
commit
cd8cff9a0e
23
src/test/java/NegativeTests.java
Normal file
23
src/test/java/NegativeTests.java
Normal 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"));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
public class AddressingFieldWithoutThis {
|
||||||
|
int x;
|
||||||
|
public AddressingFieldWithoutThis() {
|
||||||
|
x = 5;
|
||||||
|
}
|
||||||
|
}
|
BIN
src/test/testFiles/Negative/PublicMissingInClass.class
Normal file
BIN
src/test/testFiles/Negative/PublicMissingInClass.class
Normal file
Binary file not shown.
2
src/test/testFiles/Negative/PublicMissingInClass.java
Normal file
2
src/test/testFiles/Negative/PublicMissingInClass.java
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
class PublicMissingInClass {
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user