mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-26 10:18:04 +00:00
cleaned up tests
This commit is contained in:
parent
a3fa33b922
commit
ade2c3f10e
39
README.md
39
README.md
@ -32,17 +32,17 @@
|
||||
|
||||
### Tests für den Scanner, Parser und Typecheck:
|
||||
- Die Testfiles (.java), die alle Features abdecken, sind im Ordner `src/test/testFiles/ASTandTypedASTFeatures` zu finden.
|
||||
Ihr Name gibt circa an, welches Feature / welche Features sie abdecken
|
||||
- Ihre manuell übersetzten ASTs und TypedASTs befinden sich im Ordner `src/test/testFiles/ASTandTypedASTFeatures`
|
||||
- Die Klasse `src/test/java/ScannerParserTests.java` enthält die JUnit-Tests, die die korrekte Umwandlung der Testfiles in AST
|
||||
durch den Compiler prüfen, indem sie den durch den Compiler generierten AST mit dem manuell erstellten AST vergleichen
|
||||
- Die Klasse `src/test/java/TypingTests.java` enthält die JUnit-Tests, die die korrekte Umwandlung der manuell erstellten ASTs
|
||||
in TypedASTs durch den Compiler prüfen, indem sie den durch den Compiler generierten TypedAST mit dem manuell erstellten
|
||||
TypedAST vergleichen
|
||||
Der Name des jeweiligen Files gibt circa an, welches Feature / welche Features es abdeckt.
|
||||
- Ihre manuell übersetzten ASTs befinden sich im Ordner `src/test/java/ScannerParserTests/FeaturesASTs`
|
||||
- Die Übereinstimmung der manuell übersetzten ASTs mit den vom Compiler generierten ASTs wird mit JUnit-Tests im File
|
||||
`src/test/java/ScannerParserTests/ScannerParserTests.java` überprüft
|
||||
- Die manuell übersetzten TypedASTs befinden sich im Ordner `src/test/java/TypeCheckTests/FeaturesTypedASTs`
|
||||
- Die Übereinstimmung der manuell übersetzten TypedASTs mit den vom Compiler generierten TypedASTs wird mit JUnit-Tests im File
|
||||
`src/test/java/TypeCheckTests/TypingTests.java` überprüft
|
||||
- Weitere Testfiles, die nicht unbedingt auf ein bestimmtes Feature abzielen, sind im Ordner `src/test/testFiles/MoreTestFiles`
|
||||
zu finden, die manuell übersetzen ASTs und TypedASTs dazu sind im Ordner `src/test/java/MoreTestResources` zu finden.
|
||||
Die korrekte Umwandlung dieser Testfiles in AST und TypedAST wird ebenfalls durch die Klassen `src/test/java/ScannerParserTests.java`
|
||||
und `src/test/java/TypingTests.java` geprüft, jedoch sind die Unit-Tests hier nicht vollständig.
|
||||
zu finden, die manuell übersetzen ASTs und TypedASTs dazu sind im Ordner `src/test/java/ScannerParserTests/MoreTestsASTs`
|
||||
und `src/test/java/TypeCheckTests/MoreTestsTypedASTs` zu finden. Die korrekte Umwandlung der Testfiles in AST und
|
||||
TypedAST wird in den gleichen Testklassen wie die Features getestet.
|
||||
|
||||
### Tests für den gesamten Compiler:
|
||||
- Da die Kompilierung der Testfiles für den Scanner, Parser und Typecheck teilweise nicht gut mit Reflections testbar ist,
|
||||
@ -51,21 +51,16 @@
|
||||
Testklassen haben jeweils einen Namen, der sich aus `E2E_` und dem Namen des Testfiles zusammensetzt. Sie prüfen
|
||||
mithilfe der Hilfsklasse `src/test/java/E2ETests/BytecodeTestUtil.java`, ob der Compiler die Testfiles korrekt in
|
||||
class-Files umwandelt. Die Hilfsklasse erstellt ein Class<?>-Objekt der Klasse und implementiert Methoden, welche mit
|
||||
Reflections Werte aus dem Objekt auslesen und zurückgeben. Diese Werte werden dann mit den erwarteten Werten in der
|
||||
jeweiligen Testklasse verglichen.
|
||||
- Die Klasse `src/test/java/AllE2ETests.java` führt mithilfe der Klasse `src/test/java/HelpClasses/TestFileTester.java`
|
||||
alle Testklassen für die E2E-Tests der einzelnen Features aus und gibt deren Ergebnis aus. Somit muss für das E2E-Testen
|
||||
der gesamten Features nur diese Klasse ausgeführt werden.
|
||||
Reflections Werte aus einem Objekt der Klasse auslesen und zurückgeben. Diese Werte werden dann mit den erwarteten
|
||||
Werten in der jeweiligen Testklasse verglichen.
|
||||
|
||||
### Negative Tests:
|
||||
- Um zu überprüfen, dass der Compiler auch bei fehlerhaften Testfiles fehlschlägt, gibt es Testfiles im Ordner
|
||||
`src/test/testFiles/Negative`, welche nicht korrekt kompiliert werden können. Die Testfiles sin in mehrere Kategorien
|
||||
`src/test/testFiles/Negative`, welche nicht korrekt kompiliert werden können. Die Testfiles sind in mehrere Kategorien
|
||||
unterteilt, die durch die Ordnerstruktur in `src/test/testFiles/Negative` dargestellt werden. Für jede Kategorie gibt es
|
||||
eine eigene Testklasse, die sich im Ordner `src/test/java/NegativeTests` befindet und den gleichen Namen wie der Ordner
|
||||
ihrer Kategorie hat. Diese Testklassen versuchen die Testfiles ihrer Kategorie zu kompilieren und erwarten, dass der
|
||||
Compiler fehlschlägt.
|
||||
- Wie bei den E2E-Tests gibt es auch hier eine Klasse `src/test/java/AllNegativeTests.java`, die neben eigenen Tests auch
|
||||
alle Testklassen für die negativen Tests ausführt und deren Ergebnis ausgibt. Somit muss für das Testen der negativen
|
||||
Tests nur diese Klasse ausgeführt werden.
|
||||
- Bitte die Ausgabe in der Konsole ignorieren, diese Fehlermeldungen sind die erwarteten Fehlermeldungen, die der Compiler
|
||||
ausgeben sollte, werden in diesem Test-Fall jedoch nicht unterdrückt.
|
||||
Compiler fehlschlägt. Die Testfiles, die in keine Kategorie passen werden in der Testklasse
|
||||
`src/test/java/NegativeTests/RestOfNegativeTests.java` getestet
|
||||
- Hinweis: Bitte die Ausgabe in der Konsole ignorieren, diese Fehlermeldungen sind die erwarteten Fehlermeldungen,
|
||||
die der Compiler ausgeben soll, werden in diesem Test-Fall jedoch nicht unterdrückt.
|
@ -1,125 +0,0 @@
|
||||
import E2ETests.Features.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static HelpClasses.TestFileTester.run;
|
||||
|
||||
/**
|
||||
* This class runs all the E2E test classes.
|
||||
*/
|
||||
class AllE2ETests {
|
||||
|
||||
@Test
|
||||
void runE2EBreakTests() {
|
||||
run(E2E_Break.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EClassTests() {
|
||||
run(E2E_Class.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EClassObjectsTests() {
|
||||
run(E2E_ClassObjects.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2ECommentTests() {
|
||||
run(E2E_Comment.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2ECompAssignTests() {
|
||||
run(E2E_CompAssign.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EComplexCallsTests() {
|
||||
run(E2E_ComplexCalls.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EConstructorTests() {
|
||||
run(E2E_Constructor.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EContinueTests() {
|
||||
run(E2E_Continue.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EDataTypesTests() {
|
||||
run(E2E_DataTypes.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EFieldTests() {
|
||||
run(E2E_Field.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EForTests() {
|
||||
run(E2E_For.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EIfTests() {
|
||||
run(E2E_If.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2ELogicExprTests() {
|
||||
run(E2E_LogicExpr.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EMainTests() {
|
||||
run(E2E_Main.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EMethodTests() {
|
||||
run(E2E_Method.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EMethodCallTests() {
|
||||
run(E2E_MethodCall.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EOperatorsTests() {
|
||||
run(E2E_Operators.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EOverloadedTests() {
|
||||
run(E2E_Overloaded.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EPrintTests() {
|
||||
run(E2E_Print.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EReturnTests() {
|
||||
run(E2E_Return.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EUnaryTests() {
|
||||
run(E2E_Unary.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EVariableDefWithDeclTests() {
|
||||
run(E2E_VariableDefWithDecl.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runE2EWhileTests() {
|
||||
run(E2E_While.class);
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package HelpClasses;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.platform.commons.support.HierarchyTraversalMode;
|
||||
import org.junit.platform.commons.support.ReflectionSupport;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class TestFileTester {
|
||||
/**
|
||||
* Execute all methods annotated with @Test in the given class.
|
||||
*
|
||||
* @param testClass The class containing the test methods.
|
||||
*/
|
||||
public static void run(Class<?> testClass) {
|
||||
List<String> failedTests = new ArrayList<>();
|
||||
|
||||
// Find all methods annotated with @Test in the given class and save them in a list
|
||||
List<Method> testMethods = ReflectionSupport.findMethods(
|
||||
testClass,
|
||||
method -> method.isAnnotationPresent(Test.class),
|
||||
HierarchyTraversalMode.TOP_DOWN
|
||||
);
|
||||
|
||||
// Execute for all test methods found
|
||||
for (Method testMethod : testMethods) {
|
||||
try {
|
||||
// Create an instance of the test class
|
||||
Object testInstance = ReflectionSupport.newInstance(testClass);
|
||||
|
||||
// Execute all methods annotated with @BeforeEach in the given class
|
||||
List<Method>beforeEachMethods = ReflectionSupport.findMethods(
|
||||
testClass,
|
||||
method -> method.isAnnotationPresent(BeforeEach.class),
|
||||
HierarchyTraversalMode.TOP_DOWN
|
||||
);
|
||||
for (Method beforeEachMethod : beforeEachMethods) {
|
||||
beforeEachMethod.invoke(testInstance);
|
||||
}
|
||||
|
||||
// Execute the test method
|
||||
testMethod.invoke(testInstance);
|
||||
|
||||
// Execute all methods annotated with @AfterEach in the given class
|
||||
List<Method> afterEachMethods = ReflectionSupport.findMethods(
|
||||
testClass,
|
||||
method -> method.isAnnotationPresent(AfterEach.class),
|
||||
HierarchyTraversalMode.TOP_DOWN
|
||||
);
|
||||
for (Method afterEachMethod : afterEachMethods) {
|
||||
afterEachMethod.invoke(testInstance);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// If the test method throws an exception, save the exception message in the failedTests list
|
||||
if (e.getCause() != null) {
|
||||
failedTests.add(testMethod.getName() + ": " + e.getCause().getMessage());
|
||||
} else {
|
||||
failedTests.add(testMethod.getName() + ": " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there are failed tests, print them and fail the test class, otherwise print a success message
|
||||
if (!failedTests.isEmpty()) {
|
||||
failedTests.forEach(System.err::println);
|
||||
Assertions.fail("Ein oder mehrere Tests sind fehlgeschlagen.");
|
||||
} else {
|
||||
System.out.println("Alle Tests sind erfolgreich.");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,41 +1,17 @@
|
||||
import NegativeTests.*;
|
||||
package NegativeTests;
|
||||
|
||||
import de.maishai.Compiler;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static HelpClasses.TestFileTester.run;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
* This class runs all negative tests plus some additional tests that did not fit into any of the categories.
|
||||
* Tests for rest of testfiles which did not fit in any Category
|
||||
* see src/test/testFiles/Negative for the test files.
|
||||
*/
|
||||
class AllNegativeTests {
|
||||
|
||||
@Test
|
||||
void runCallVariableOutsideScopeTests() {
|
||||
run(CallVariableOutsideScope.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runForbiddenParticularitiesInImplementationTests() {
|
||||
run(ForbiddenParticularitiesInImplementation.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runMissingComponentsTests() {
|
||||
run(MissingComponents.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runUsingSameNameTests() {
|
||||
run(UsingSameName.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void runWrongTypeTests() {
|
||||
run(WrongType.class);
|
||||
}
|
||||
public class RestOfNegativeTests {
|
||||
|
||||
// A value is assigned to a field outside a method
|
||||
@Test
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.Block;
|
||||
import de.maishai.ast.records.Constructor;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.Block;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.Class;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.UnaryOperator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.records.*;
|
||||
import de.maishai.ast.records.Class;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.AST;
|
||||
package ScannerParserTests.FeaturesASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;
|
||||
package ScannerParserTests.MoreTestsASTs;
|
||||
|
||||
import de.maishai.ast.records.Class;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;
|
||||
package ScannerParserTests.MoreTestsASTs;
|
||||
|
||||
import de.maishai.ast.*;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithConstructorAndMethodCall {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithConstructorAndMethodCall {
|
||||
// int x;
|
||||
//
|
||||
// public ClassWithConstructorAndMethodCall() {
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithConstructorWithCodeInComments {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithConstructorWithCodeInComments {
|
||||
// int x;
|
||||
// public ClassWithConstructorWithCodeInComments() {
|
||||
// this.x = 10;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithConstructorWithParameters {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithConstructorWithParameters {
|
||||
// int x;
|
||||
// public ClassWithConstructorWithParameters(int startValue, int repetitions) {
|
||||
// this.x = startValue;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithField {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithField {
|
||||
// int x;
|
||||
//}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithMethod {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithMethod {
|
||||
// public boolean method() {
|
||||
// return false;
|
||||
// }
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithMethodAndField {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithMethodAndField {
|
||||
// char c;
|
||||
//
|
||||
// public ClassWithMethodAndField(char character) {
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class ClassWithMoreComplexMethodAndMain {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class ClassWithMoreComplexMethodAndMain {
|
||||
// ClassWithMoreComplexMethodAndMain instance;
|
||||
//
|
||||
// public boolean moreComplexMethod() {
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;
|
||||
package ScannerParserTests.MoreTestsASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.ast.records.*;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.AST;//public class PublicClass {
|
||||
package ScannerParserTests.MoreTestsASTs;//public class PublicClass {
|
||||
//}
|
||||
|
||||
import de.maishai.ast.records.Block;
|
@ -1,10 +1,13 @@
|
||||
package ScannerParserTests;
|
||||
|
||||
import TypeCheckTests.MoreTestResources.MoreTestsASTs.*;
|
||||
import ScannerParserTests.FeaturesASTs.*;
|
||||
import ScannerParserTests.MoreTestsASTs.*;
|
||||
import de.maishai.Compiler;
|
||||
import de.maishai.ast.records.Program;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import FeatureTestResources.AST.*;
|
||||
|
||||
import MoreTestResources.AST.*;
|
||||
import TypeCheckTests.AST.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.TypedBlock;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.TypedBlock;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.UnaryOperator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.typedast.Type;
|
||||
import de.maishai.typedast.typedclass.*;
|
@ -1,4 +1,4 @@
|
||||
package FeatureTestResources.TypedAST;
|
||||
package TypeCheckTests.FeaturesTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithConstructor {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithConstructor {
|
||||
// int x;
|
||||
// public classWithConstructor() {
|
||||
// this.x = 10;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithConstructorAndMethodCall {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithConstructorAndMethodCall {
|
||||
// int x;
|
||||
//
|
||||
// public ClassWithConstructorAndMethodCall() {
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithConstructorWithCodeInComments {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithConstructorWithCodeInComments {
|
||||
// int x;
|
||||
// public ClassWithConstructorWithCodeInComments() {
|
||||
// this.x = 10;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithConstructorWithParameters {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithConstructorWithParameters {
|
||||
// int x;
|
||||
// public classWithConstructorWithParameters(int startValue, int repetitions) {
|
||||
// this.x = startValue;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithField {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithField {
|
||||
// int x;
|
||||
//}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithMethod {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithMethod {
|
||||
// public boolean method() {
|
||||
// return false;
|
||||
// }
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithMethodAndField {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithMethodAndField {
|
||||
// char c;
|
||||
//
|
||||
// public ClassWithMethodAndField(char character) {
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class ClassWithMoreComplexMethodAndMain {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class ClassWithMoreComplexMethodAndMain {
|
||||
// ClassWithMoreComplexMethodAndMain instance;
|
||||
//
|
||||
// public boolean moreComplexMethod() {
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;
|
||||
package TypeCheckTests.MoreTestsTypedASTs;
|
||||
|
||||
import de.maishai.ast.Operator;
|
||||
import de.maishai.typedast.Type;
|
@ -1,4 +1,4 @@
|
||||
package MoreTestResources.TypedAST;//public class PublicClass {
|
||||
package TypeCheckTests.MoreTestsTypedASTs;//public class PublicClass {
|
||||
//}
|
||||
|
||||
import de.maishai.typedast.Type;
|
@ -1,12 +1,20 @@
|
||||
package TypeCheckTests;
|
||||
|
||||
import ScannerParserTests.MoreTestsASTs.AbstractSyntax_ClassWithConstructor;
|
||||
import ScannerParserTests.MoreTestsASTs.AbstractSyntax_ClassWithField;
|
||||
import ScannerParserTests.MoreTestsASTs.AbstractSyntax_ComplexClass;
|
||||
import ScannerParserTests.MoreTestsASTs.AbstractSyntax_PublicClass;
|
||||
import TypeCheckTests.MoreTestsTypedASTs.TypedAbstractSyntax_ClassWithConstructor;
|
||||
import TypeCheckTests.MoreTestsTypedASTs.TypedAbstractSyntax_ClassWithField;
|
||||
import TypeCheckTests.MoreTestsTypedASTs.TypedAbstractSyntax_ComplexClass;
|
||||
import TypeCheckTests.MoreTestsTypedASTs.TypedAbstractSyntax_PublicClass;
|
||||
import ScannerParserTests.FeaturesASTs.*;
|
||||
import de.maishai.Compiler;
|
||||
import de.maishai.typedast.typedclass.TypedProgram;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import FeatureTestResources.AST.*;
|
||||
import FeatureTestResources.TypedAST.*;
|
||||
|
||||
import MoreTestResources.AST.*;
|
||||
import MoreTestResources.TypedAST.*;
|
||||
import TypeCheckTests.AST.*;
|
||||
import TypeCheckTests.FeaturesTypedASTs.*;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
/**
|
Loading…
Reference in New Issue
Block a user