summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-16 15:28:03 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-16 15:39:25 +0100
commitcc5f14193c25200e254e64cc594b15e84da280f9 (patch)
tree3659be64d81dc3c0b2b4b36dd70f1d9bb949fcb1 /tests/typ
parent51efb0f4d69943e290d977673970cd3c8ada306f (diff)
Flip test directory structure 🔃
Move full/lang/library to the top-level as that's more ergonomic to use.
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/full/coma.typ25
-rw-r--r--tests/typ/lang/arrays.typ33
-rw-r--r--tests/typ/lang/basics.typ14
-rw-r--r--tests/typ/lang/blocks.typ21
-rw-r--r--tests/typ/lang/bracket-call.typ101
-rw-r--r--tests/typ/lang/comments.typ18
-rw-r--r--tests/typ/lang/dictionaries.typ14
-rw-r--r--tests/typ/lang/empty.typ0
-rw-r--r--tests/typ/lang/escaping.typ25
-rw-r--r--tests/typ/lang/expressions.typ37
-rw-r--r--tests/typ/lang/headings.typ38
-rw-r--r--tests/typ/lang/let.typ20
-rw-r--r--tests/typ/lang/raw.typ23
-rw-r--r--tests/typ/lang/values.typ33
-rw-r--r--tests/typ/library/font.typ56
-rw-r--r--tests/typ/library/hv.typ22
-rw-r--r--tests/typ/library/image.typ39
-rw-r--r--tests/typ/library/page.typ54
-rw-r--r--tests/typ/library/pagebreak.typ3
-rw-r--r--tests/typ/library/rgb.typ17
20 files changed, 0 insertions, 593 deletions
diff --git a/tests/typ/full/coma.typ b/tests/typ/full/coma.typ
deleted file mode 100644
index b7863fce..00000000
--- a/tests/typ/full/coma.typ
+++ /dev/null
@@ -1,25 +0,0 @@
-[page width: 450pt, height: 300pt, margins: 1cm]
-
-[box][
- *Technische Universität Berlin* \
- *Fakultät II, Institut for Mathematik* \
- Sekretariat MA \
- Dr. Max Mustermann \
- Ola Nordmann, John Doe
-]
-[align right | box][*WiSe 2019/2020* \ Woche 3]
-
-[v 6mm]
-
-[align center][
- #### 3. Übungsblatt Computerorientierte Mathematik II [v 2mm]
- *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) [v 2mm]
- *Alle Antworten sind zu beweisen.*
-]
-
-*1. Aufgabe* [align right][(1 + 1 + 2 Punkte)]
-
-Ein _Binärbaum_ ist ein Wurzelbaum, in dem jeder Knoten ≤ 2 Kinder hat.
-Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel
-zu _v_, und die Höhe von _v_ ist die Länge eines längsten (absteigenden) Weges
-von _v_ zu einem Blatt. Die Höhe des Baumes ist die Höhe der Wurzel.
diff --git a/tests/typ/lang/arrays.typ b/tests/typ/lang/arrays.typ
deleted file mode 100644
index 0b8fb866..00000000
--- a/tests/typ/lang/arrays.typ
+++ /dev/null
@@ -1,33 +0,0 @@
-// Empty.
-{()}
-
-// One item and trailing comma.
-{(-1,)}
-
-// No trailing comma.
-{(true, false)}
-
-// Multiple lines and items and trailing comma.
-{("one"
- , 2
- , #003
- ,)}
-
-// Error: 1:3-1:3 expected closing paren
-{(}
-
-// Error: 2:4-2:6 expected expression, found end of block comment
-// Error: 1:4-1:4 expected comma
-{(1*/2)}
-
-// Error: 1:6-1:8 expected expression, found invalid token
-{(1, 1u 2)}
-
-// Error: 1:3-1:4 expected expression, found comma
-{(,1)}
-
-// Error: 1:5-1:5 expected expression
-{(a:)}
-
-// Error: 1:6-1:10 expected expression, found named pair
-{(1, b: 2)}
diff --git a/tests/typ/lang/basics.typ b/tests/typ/lang/basics.typ
deleted file mode 100644
index 9220e376..00000000
--- a/tests/typ/lang/basics.typ
+++ /dev/null
@@ -1,14 +0,0 @@
-Hello 🌏!
-
-_Emph_ and *strong*!
-
-The non-breaking~space does not work.
-
-// Directly after word.
-Line\ Break
-
-// Spaces around.
-Line \ Break
-
-// Directly before word does not work.
-No \Break
diff --git a/tests/typ/lang/blocks.typ b/tests/typ/lang/blocks.typ
deleted file mode 100644
index cadd30dd..00000000
--- a/tests/typ/lang/blocks.typ
+++ /dev/null
@@ -1,21 +0,0 @@
-{1}
-
-// Function calls.
-{f(1)}
-{[[f 1]]}
-
-// Error: 1:2-1:2 expected expression
-{}
-
-// Error: 1:2-1:4 expected expression, found invalid token
-{1u}
-
-// Error: 1:5-1:5 expected closing brace
-{({1) + 2}
-
-// Error: 1:12-1:12 expected closing bracket
-{[*] + [ok*}
-
-// Error: 2:4-2:5 unexpected hex value
-// Error: 1:5-1:6 unexpected opening brace
-{1 #{} _end_
diff --git a/tests/typ/lang/bracket-call.typ b/tests/typ/lang/bracket-call.typ
deleted file mode 100644
index 79667e61..00000000
--- a/tests/typ/lang/bracket-call.typ
+++ /dev/null
@@ -1,101 +0,0 @@
-// Basic call, whitespace insignificant.
-[f], [ f ], [
- f
-]
-
-[f bold]
-
-[f 1,]
-
-[f a:2]
-
-[f 1, a: (3, 4), 2, b: "5"]
-
----
-// Body and no body.
-[f][[f]]
-
-// Lots of potential bodies.
-[f][f][f]
-
-// Multi-paragraph body.
-[box][
- First
-
- Second
-]
-
----
-// Chained.
-[f | f]
-
-// Multi-chain.
-[f|f|f]
-
-// With body.
-[f | box][💕]
-
-// Error: 1:2-1:2 expected function name
-[|f true]
-
-// Error: 1:6-1:6 expected function name
-[f 1|]
-
-// Error: 2:5-2:5 expected closing paren
-// Error: 1:8-1:9 expected expression, found closing paren
-[f (|f )]
-
-// With actual functions.
-[box width: 1cm | image "res/rhino.png"]
-
----
-// Error: 1:4-1:6 expected expression, found end of block comment
-[f */]
-
-// Error: 1:7-1:8 expected expression, found colon
-[f a:1:]
-
-// Error: 1:5-1:5 expected comma
-[f 1 2]
-
-// Error: 2:4-2:5 expected identifier
-// Error: 1:6-1:6 expected expression
-[f 1:]
-
-// Error: 1:4-1:5 expected identifier
-[f 1:2]
-
-// Error: 1:4-1:7 expected identifier
-[f (x):1]
-
----
-// Ref: false
-// Error: 2:2-2:3 a value of type string is not callable
-#let x = "string";
-[x]
-
-// Error: 1:2-1:3 expected function name, found hex value
-[# 1]
-
-// Error: 4:1-4:1 expected function name
-// Error: 3:1-3:1 expected closing bracket
-[
-
----
-// Ref: false
-// Error: 2:2-2:3 expected function name, found closing paren
-// Error: 3:1-3:1 expected closing bracket
-[)
-
----
-// Error: 3:1-3:1 expected closing bracket
-[f [*]
-
----
-// Error: 3:1-3:1 expected closing bracket
-[f][`a]`
-
----
-// Error: 3:1-3:1 expected quote
-// Error: 2:1-2:1 expected closing bracket
-[f "]
diff --git a/tests/typ/lang/comments.typ b/tests/typ/lang/comments.typ
deleted file mode 100644
index c5b04967..00000000
--- a/tests/typ/lang/comments.typ
+++ /dev/null
@@ -1,18 +0,0 @@
-// Test whether line comment acts as spacing.
-A// you
-B
-
-// Test whether block comment acts as spacing.
-C/*
- /* */
-*/D
-
-// Test in expressions.
-[f /*1*/ a: "b" //
-, 1]
-
-// Error: 1:7-1:9 unexpected end of block comment
-/* */ */
-
-// Unterminated block comment is okay.
-/*
diff --git a/tests/typ/lang/dictionaries.typ b/tests/typ/lang/dictionaries.typ
deleted file mode 100644
index c729b92c..00000000
--- a/tests/typ/lang/dictionaries.typ
+++ /dev/null
@@ -1,14 +0,0 @@
-// Empty
-{(:)}
-
-// Two pairs.
-{(one: 1, two: 2)}
-
-// Error: 1:9-1:10 expected named pair, found expression
-{(a: 1, b)}
-
-// Error: 4:4-4:5 expected named pair, found expression
-// Error: 3:5-3:5 expected comma
-// Error: 2:12-2:16 expected identifier
-// Error: 1:17-1:18 expected expression, found colon
-{(:1 b:[], true::)}
diff --git a/tests/typ/lang/empty.typ b/tests/typ/lang/empty.typ
deleted file mode 100644
index e69de29b..00000000
--- a/tests/typ/lang/empty.typ
+++ /dev/null
diff --git a/tests/typ/lang/escaping.typ b/tests/typ/lang/escaping.typ
deleted file mode 100644
index cb663612..00000000
--- a/tests/typ/lang/escaping.typ
+++ /dev/null
@@ -1,25 +0,0 @@
-// Escapable symbols.
-\\ \/ \[ \] \{ \} \* \_ \# \~ \` \$
-
-// No need to escape.
-( ) = ;
-
-// Unescapable.
-\a \: \; \( \)
-
-// Escaped comments.
-\//
-\/\* \*\/
-\/* \*/ *
-
-// Test unicode escape sequence.
-\u{1F3D5} == 🏕
-
-// Escaped escape sequence.
-\u{41} vs. \\u\{41\}
-
-// Error: 1:1-1:11 invalid unicode escape sequence
-\u{FFFFFF}
-
-// Error: 1:6-1:6 expected closing brace
-\u{41*Bold*
diff --git a/tests/typ/lang/expressions.typ b/tests/typ/lang/expressions.typ
deleted file mode 100644
index 01725289..00000000
--- a/tests/typ/lang/expressions.typ
+++ /dev/null
@@ -1,37 +0,0 @@
-#let a = 2;
-#let b = 4;
-
-// Unary operations.
-{+1}
-{-1}
-{--1}
-
-// Binary operations.
-{"a"+"b"}
-{1-2}
-{a * b}
-{12pt/.4}
-
-// Associativity.
-{1+2+3}
-{1/2*3}
-
-// Precedence.
-{1+2*-3}
-
-// Parentheses.
-{(a)}
-{(2)}
-{(1+2)*3}
-
-// Confusion with floating-point literal.
-{1e+2-1e-2}
-
-// Error: 1:3-1:3 expected expression
-{-}
-
-// Error: 1:4-1:4 expected expression
-{1+}
-
-// Error: 1:4-1:4 expected expression
-{2*}
diff --git a/tests/typ/lang/headings.typ b/tests/typ/lang/headings.typ
deleted file mode 100644
index f62f6534..00000000
--- a/tests/typ/lang/headings.typ
+++ /dev/null
@@ -1,38 +0,0 @@
-// Test different numbers of hashtags.
-
-# One
-### Three
-###### Six
-
-// Warning: 1:1-1:8 section depth should not exceed 6
-####### Seven
-
----
-// Test heading vs. no heading.
-
-/**/ # Heading
-{[## Heading]}
-[box][### Heading]
-
-\# No heading
-
-Text with # hashtag
-
-Nr#1
-
-// Error: 1:1-1:6 unexpected invalid token
-#nope
-
----
-// Heading continuation over linebreak.
-
-# This {
- "works"
-}
-
-# [box][
- This
-] too
-
-# This
-does not
diff --git a/tests/typ/lang/let.typ b/tests/typ/lang/let.typ
deleted file mode 100644
index c7bba747..00000000
--- a/tests/typ/lang/let.typ
+++ /dev/null
@@ -1,20 +0,0 @@
-// Automatically initialized with `none`.
-#let x;
-{(x,)}
-
-// Can start with underscore.
-#let _y=1;
-{_y}
-
-// Multiline.
-#let z = "world"
- + " 🌏"; Hello, {z}!
-
-// Error: 1:6-1:7 expected identifier, found integer
-#let 1;
-
-// Error: 4:1-4:3 unexpected identifier
-// Error: 3:4-3:9 unexpected identifier
-// Error: 3:1-3:1 expected semicolon
-#let x = ""
-Hi there
diff --git a/tests/typ/lang/raw.typ b/tests/typ/lang/raw.typ
deleted file mode 100644
index 22eda139..00000000
--- a/tests/typ/lang/raw.typ
+++ /dev/null
@@ -1,23 +0,0 @@
-The keyword ``rust let``.
-
-`#let x = 1`
-`[f 1]`
-
----
-[font 6pt]
-
-``py
-import this
-
-def say_hi():
- print("Hello World!")
-``
-
----
-````
-```backticks```
-````
-
----
-// Error: 2:1-2:1 expected backtick(s)
-`endless
diff --git a/tests/typ/lang/values.typ b/tests/typ/lang/values.typ
deleted file mode 100644
index ce41fc43..00000000
--- a/tests/typ/lang/values.typ
+++ /dev/null
@@ -1,33 +0,0 @@
-#let name = "Typst";
-#let ke-bab = "Kebab!";
-#let α = "Alpha";
-
-{name} \
-{ke-bab} \
-{α} \
-{none} (empty) \
-{true} \
-{false} \
-{1.0e-4} \
-{3.15} \
-{1e-10} \
-{50.368%} \
-{0.0000012345pt} \
-{4.5cm} \
-{12e1pt} \
-{2.5rad} \
-{45deg} \
-{"hi"} \
-{"a\n[]\"\u{1F680}string"} \
-{#f7a20500} \
-{[*{"Hi"} [f 1]*]} \
-{{1}}
-
-// Error: 1:1-1:4 unknown variable
-{_} \
-
-// Error: 1:2-1:5 invalid color
-{#a5}
-
-// Error: 1:2-1:4 expected expression, found invalid token
-{1u}
diff --git a/tests/typ/library/font.typ b/tests/typ/library/font.typ
deleted file mode 100644
index beaddd4e..00000000
--- a/tests/typ/library/font.typ
+++ /dev/null
@@ -1,56 +0,0 @@
-// Test configuring font properties.
-
-[font "PT Sans", 10pt]
-
-// Set same font size in three different ways.
-[font 20pt][A]
-[font 200%][A]
-[font 15pt + 50%][A]
-
-// Do nothing.
-[font][Normal]
-
-// Set style (is available).
-[font style: italic][Italic]
-
-// Set weight (is available).
-[font weight: bold][Bold]
-
-// Set stretch (not available, matching closest).
-[font stretch: ultra-condensed][Condensed]
-
-// Error: 1:7-1:12 unexpected argument
-[font false]
-
-// Error: 3:14-3:18 expected font style, found font weight
-// Error: 2:28-2:34 expected font weight, found string
-// Error: 1:43-1:44 expected font family or array of font families, found integer
-[font style: bold, weight: "thin", serif: 0]
-
-// Warning: 1:15-1:19 must be between 100 and 900
-[font weight: 2700]
-
-// Error: 1:7-1:27 unexpected argument
-[font something: "invalid"]
-
----
-// Test font fallback and class definitions.
-
-// Source Sans Pro + Segoe UI Emoji.
-Emoji: 🏀
-
-// CMU Serif + Noto Emoji.
-[font "CMU Serif", "Noto Emoji"][
- Emoji: 🏀
-]
-
-// Class definitions.
-[font serif: ("CMU Serif", "Latin Modern Math", "Noto Emoji")]
-[font serif][
- Math: ∫ α + β ➗ 3
-]
-
-// Class definition reused.
-[font sans-serif: "Noto Emoji"]
-[font sans-serif: ("Archivo", sans-serif)]
-New sans-serif. 🚀
diff --git a/tests/typ/library/hv.typ b/tests/typ/library/hv.typ
deleted file mode 100644
index 36a6d242..00000000
--- a/tests/typ/library/hv.typ
+++ /dev/null
@@ -1,22 +0,0 @@
-// Ends paragraphs.
-Tightly [v -5pt] packed
-
-// Eating up soft spacing.
-Inv [h 0pt] isible
-
-// Multiple spacings in a row.
-Add [h 10pt] [h 10pt] up
-
-// Relative to font size.
-Relative [h 100%] spacing
-
-// Missing spacing.
-// Error: 1:11-1:11 missing argument: spacing
-Totally [h] ignored
-
-// Swapped axes.
-[page main-dir: rtl, cross-dir: ttb, height: 80pt][
- 1 [h 1cm] 2
-
- 3 [v 1cm] 4 [v -1cm] 5
-]
diff --git a/tests/typ/library/image.typ b/tests/typ/library/image.typ
deleted file mode 100644
index 2e7b1eb5..00000000
--- a/tests/typ/library/image.typ
+++ /dev/null
@@ -1,39 +0,0 @@
-// Test loading different image formats.
-
-// Load an RGBA PNG image.
-[image "res/rhino.png"]
-[pagebreak]
-
-// Load an RGB JPEG image.
-[image "res/tiger.jpg"]
-
-// Error: 1:8-1:29 failed to load image
-[image "path/does/not/exist"]
-
-// Error: 1:8-1:29 failed to load image
-[image "typ/image-error.typ"]
-
----
-// Test configuring the size and fitting behaviour of images.
-
-// Fit to width of page.
-[image "res/rhino.png"]
-
-// Fit to height of page.
-[page height: 40pt][
- [image "res/rhino.png"]
-]
-
-// Set width explicitly.
-[image "res/rhino.png", width: 50pt]
-
-// Set height explicitly.
-[image "res/rhino.png", height: 50pt]
-
-// Set width and height explicitly and force stretching.
-[image "res/rhino.png", width: 25pt, height: 50pt]
-
-// Make sure the bounding-box of the image is correct.
-[align bottom, right][
- [image "res/tiger.jpg", width: 60pt]
-]
diff --git a/tests/typ/library/page.typ b/tests/typ/library/page.typ
deleted file mode 100644
index 9eeddc93..00000000
--- a/tests/typ/library/page.typ
+++ /dev/null
@@ -1,54 +0,0 @@
-// Test configuring page sizes and margins.
-
-// Set width and height.
-[page width: 120pt, height: 120pt]
-[page width: 40pt][High]
-[page height: 40pt][Wide]
-
-// Set all margins at once.
-[page margins: 30pt][
- [align top, left][TL]
- [align bottom, right][BR]
-]
-
-// Set individual margins.
-[page height: 40pt]
-[page left: 0pt | align left][Left]
-[page right: 0pt | align right][Right]
-[page top: 0pt | align top][Top]
-[page bottom: 0pt | align bottom][Bottom]
-
-// Ensure that specific margins override general margins.
-[page margins: 0pt, left: 20pt][Overriden]
-
-// Error: 1:7-1:18 unknown variable
-[page nonexistant]
-
-// Error: 1:17-1:20 aligned axis
-[page main-dir: ltr]
-
-// Flipped predefined paper.
-[page "a11", flip: true][Flipped A11]
-
-// Flipped custom page size.
-[page width: 40pt, height: 120pt]
-[page flip: true]
-Wide
-
-// Test changing the layouting directions of pages.
-
-[page height: 50pt, main-dir: btt, cross-dir: rtl]
-Right to left!
-
----
-// Test a combination of pages with bodies and normal content.
-
-[page height: 50pt]
-
-[page][First]
-[page][Second]
-[pagebreak]
-Fourth
-[page][]
-Sixth
-[page][Seventh and last]
diff --git a/tests/typ/library/pagebreak.typ b/tests/typ/library/pagebreak.typ
deleted file mode 100644
index 2f539ce0..00000000
--- a/tests/typ/library/pagebreak.typ
+++ /dev/null
@@ -1,3 +0,0 @@
-First of two
-[pagebreak]
-[page height: 40pt]
diff --git a/tests/typ/library/rgb.typ b/tests/typ/library/rgb.typ
deleted file mode 100644
index 66d63d0d..00000000
--- a/tests/typ/library/rgb.typ
+++ /dev/null
@@ -1,17 +0,0 @@
-// Check the output.
-[rgb 0.0, 0.3, 0.7]
-
-// Alpha channel.
-[rgb 1.0, 0.0, 0.0, 0.5]
-
-// Warning: 2:6-2:9 must be between 0.0 and 1.0
-// Warning: 1:11-1:15 must be between 0.0 and 1.0
-[rgb -30, 15.5, 0.5]
-
-// Error: 1:6-1:10 missing argument: blue component
-[rgb 0, 1]
-
-// Error: 3:5-3:5 missing argument: red component
-// Error: 2:5-2:5 missing argument: green component
-// Error: 1:5-1:5 missing argument: blue component
-[rgb]