This commit is contained in:
Me 2021-01-27 10:26:12 +01:00
commit 8663fb3b66
5 changed files with 62 additions and 1 deletions

3
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,3 @@
build:
script:
- mvn -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp test

25
pom.xml
View File

@ -62,6 +62,13 @@
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -97,6 +104,19 @@
<version>3.8.1</version> <version>3.8.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -130,6 +150,11 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -19,6 +19,7 @@ import org.vaadin.artur.helpers.LaunchUtil;
public class Application extends SpringBootServletInitializer implements AppShellConfigurator { public class Application extends SpringBootServletInitializer implements AppShellConfigurator {
public static void main(String[] args) { public static void main(String[] args) {
System.setProperty("user.home", "/home/arne/.cache");
LaunchUtil.launchBrowserInDevelopmentMode(SpringApplication.run(Application.class, args)); LaunchUtil.launchBrowserInDevelopmentMode(SpringApplication.run(Application.class, args));
} }

View File

@ -1,7 +1,25 @@
package edu.kit.typicalc.model.term; package edu.kit.typicalc.model.term;
import java.util.Objects;
public class VarTerm extends LambdaTerm { public class VarTerm extends LambdaTerm {
public VarTerm(String s) { private final String name;
public VarTerm(String name) {
super(); super();
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VarTerm varTerm = (VarTerm) o;
return Objects.equals(name, varTerm.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
} }
} }

View File

@ -0,0 +1,14 @@
package edu.kit.typicalc.model.parser;
import static org.junit.jupiter.api.Assertions.assertEquals;
import edu.kit.typicalc.model.term.VarTerm;
import org.junit.jupiter.api.Test;
class LambdaParserTest {
@Test
void varTerm() {
LambdaParser parser = new LambdaParser("x");
assertEquals(parser.parse().unwrap(), new VarTerm("x"));
}
}