change: added tests for invalid configurations
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 10s Details

This commit is contained in:
Sven Vogel 2024-07-02 11:11:33 +02:00
parent f8f80dfa52
commit 54956cadf2
4 changed files with 100 additions and 2 deletions

View File

@ -1,7 +1,5 @@
#!/bin/bash
set -e
function abort() {
echo "test case `$1` has failed" 1>&2
exit 1
@ -15,4 +13,21 @@ echo "Running tests..."
echo "Running test local-import..."
typst compile tests/local-import/main.typ --root . || abort "local-import"
echo "Running test invalid-config..."
echo "Expected to fail..."
typst compile tests/invalid-config/test-case-1.typ --root .
if [ $? -eq 0 ]; then
abort "invalid-config case 1"
fi
typst compile tests/invalid-config/test-case-2.typ --root . || abort "invalid-config case 2"
echo "Expected to fail..."
typst compile tests/invalid-config/test-case-3.typ --root .
if [ $? -eq 0 ]; then
abort "invalid-config case 3b"
fi
echo "Tests completed successfully"

View File

@ -0,0 +1,29 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(
config: (
lang: none,
region: "en",
author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik",
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
bibliography: none,
glossary: none,
appendices: none)))

View File

@ -0,0 +1,30 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(
config: (
lang: "en",
this-key-is-not-in-config: "Ha Ha",
region: "en",
author: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik",
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
bibliography: none,
glossary: none,
appendices: none)))

View File

@ -0,0 +1,24 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(
config: (
lang: "en",
region: "en",
author: (
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: none,
matriculation-number: 123456789),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
submission-date: "23rd march 2020",
timeframe: "1st january 2020 - 20th march 2020",
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
bibliography: none,
glossary: none,
appendices: none)))