summaryrefslogtreecommitdiff
path: root/tests/typ/compiler/include.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/compiler/include.typ')
-rw-r--r--tests/typ/compiler/include.typ32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/typ/compiler/include.typ b/tests/typ/compiler/include.typ
new file mode 100644
index 00000000..289fea21
--- /dev/null
+++ b/tests/typ/compiler/include.typ
@@ -0,0 +1,32 @@
+// Test module includes.
+
+---
+#set page(width: 200pt)
+
+= Document
+
+// Include a file
+#include "/typ/compiler/modules/chap1.typ"
+
+// Expression as a file name.
+#let chap2 = include "modu" + "les/chap" + "2.typ"
+
+-- _Intermission_ --
+#chap2
+
+---
+{
+ // Error: 19-38 file not found (searched at typ/compiler/modules/chap3.typ)
+ let x = include "modules/chap3.typ"
+}
+
+---
+#include "modules/chap1.typ"
+
+// The variables of the file should not appear in this scope.
+// Error: 1-6 unknown variable
+#name
+
+---
+// Error: 18 expected semicolon or line break
+#include "hi.typ" Hi