summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NOTICE20
-rw-r--r--assets/files/bad.csv (renamed from tests/res/bad.csv)0
-rw-r--r--assets/files/bad.json (renamed from tests/res/bad.json)0
-rw-r--r--assets/files/bad.svg (renamed from tests/res/bad.svg)0
-rw-r--r--assets/files/bad.xml (renamed from tests/res/bad.xml)0
-rw-r--r--assets/files/data.xml (renamed from tests/res/data.xml)0
-rw-r--r--assets/files/graph.png (renamed from tests/res/graph.png)bin18008 -> 18008 bytes
-rw-r--r--assets/files/hello.txt (renamed from tests/res/hello.txt)0
-rw-r--r--assets/files/invalid-utf8.txt (renamed from tests/res/invalid-utf8.txt)bin70 -> 70 bytes
-rw-r--r--assets/files/monkey.svg (renamed from tests/res/monkey.svg)0
-rw-r--r--assets/files/pattern.svg (renamed from tests/res/pattern.svg)0
-rw-r--r--assets/files/rhino.png (renamed from tests/res/rhino.png)bin232243 -> 232243 bytes
-rw-r--r--assets/files/tiger.jpg (renamed from tests/res/tiger.jpg)bin116679 -> 116679 bytes
-rw-r--r--assets/files/zoo.csv (renamed from tests/res/zoo.csv)0
-rw-r--r--assets/files/zoo.json (renamed from tests/res/zoo.json)0
-rw-r--r--assets/fonts/FiraMath-Regular.otf (renamed from tests/fonts/FiraMath-Regular.otf)bin179840 -> 179840 bytes
-rw-r--r--assets/fonts/IBMPlexMono-Bold.ttf (renamed from tests/fonts/IBMPlexMono-Bold.ttf)bin111944 -> 111944 bytes
-rw-r--r--assets/fonts/IBMPlexMono-Regular.ttf (renamed from tests/fonts/IBMPlexMono-Regular.ttf)bin109272 -> 109272 bytes
-rw-r--r--assets/fonts/IBMPlexSans-Bold.ttf (renamed from tests/fonts/IBMPlexSans-Bold.ttf)bin175212 -> 175212 bytes
-rw-r--r--assets/fonts/IBMPlexSans-BoldItalic.ttf (renamed from tests/fonts/IBMPlexSans-BoldItalic.ttf)bin184200 -> 184200 bytes
-rw-r--r--assets/fonts/IBMPlexSans-Italic.ttf (renamed from tests/fonts/IBMPlexSans-Italic.ttf)bin183496 -> 183496 bytes
-rw-r--r--assets/fonts/IBMPlexSans-Medium.ttf (renamed from tests/fonts/IBMPlexSans-Medium.ttf)bin177104 -> 177104 bytes
-rw-r--r--assets/fonts/IBMPlexSans-Regular.ttf (renamed from tests/fonts/IBMPlexSans-Regular.ttf)bin175232 -> 175232 bytes
-rw-r--r--assets/fonts/IBMPlexSansDevanagari-Regular.ttf (renamed from tests/fonts/IBMPlexSansDevanagari-Regular.ttf)bin350804 -> 350804 bytes
-rw-r--r--assets/fonts/IBMPlexSerif-Regular.ttf (renamed from tests/fonts/IBMPlexSerif-Regular.ttf)bin159828 -> 159828 bytes
-rw-r--r--assets/fonts/LatinModernRoman-Bold.otf (renamed from tests/fonts/LatinModernRoman-Bold.otf)bin111240 -> 111240 bytes
-rw-r--r--assets/fonts/LatinModernRoman-Regular.otf (renamed from tests/fonts/LatinModernRoman-Regular.otf)bin111536 -> 111536 bytes
-rw-r--r--assets/fonts/NewCMMath-Regular.otf (renamed from tests/fonts/NewCMMath-Regular.otf)bin1229208 -> 1229208 bytes
-rw-r--r--assets/fonts/NotoColorEmoji.ttf (renamed from tests/fonts/NotoColorEmoji.ttf)bin9867108 -> 9867108 bytes
-rw-r--r--assets/fonts/NotoSansArabic-Regular.ttf (renamed from tests/fonts/NotoSansArabic-Regular.ttf)bin140400 -> 140400 bytes
-rw-r--r--assets/fonts/NotoSansSymbols2-Regular.ttf (renamed from tests/fonts/NotoSansSymbols2-Regular.ttf)bin656828 -> 656828 bytes
-rw-r--r--assets/fonts/NotoSerifCJKsc-Regular.otf (renamed from tests/fonts/NotoSerifCJKsc-Regular.otf)bin23613224 -> 23613224 bytes
-rw-r--r--assets/fonts/NotoSerifHebrew-Bold.ttf (renamed from tests/fonts/NotoSerifHebrew-Bold.ttf)bin21376 -> 21376 bytes
-rw-r--r--assets/fonts/NotoSerifHebrew-Regular.ttf (renamed from tests/fonts/NotoSerifHebrew-Regular.ttf)bin21488 -> 21488 bytes
-rw-r--r--assets/fonts/PTSans-Regular.ttf (renamed from tests/fonts/PTSans-Regular.ttf)bin278168 -> 278168 bytes
-rw-r--r--assets/fonts/Roboto-Regular.ttf (renamed from tests/fonts/Roboto-Regular.ttf)bin305608 -> 305608 bytes
-rw-r--r--assets/fonts/TwitterColorEmoji.ttf (renamed from tests/fonts/TwitterColorEmoji.ttf)bin13356392 -> 13356392 bytes
-rw-r--r--assets/fonts/Ubuntu-Regular.ttf (renamed from tests/fonts/Ubuntu-Regular.ttf)bin299684 -> 299684 bytes
-rw-r--r--src/lib.rs6
-rw-r--r--tests/README.md2
-rw-r--r--tests/src/benches.rs6
-rw-r--r--tests/src/tests.rs16
-rw-r--r--tests/typ/coma.typ2
-rw-r--r--tests/typ/compiler/import.typ4
-rw-r--r--tests/typ/compiler/include.typ2
-rw-r--r--tests/typ/compiler/set.typ2
-rw-r--r--tests/typ/compiler/show-text.typ2
-rw-r--r--tests/typ/compute/data.typ28
-rw-r--r--tests/typ/compute/foundations.typ8
-rw-r--r--tests/typ/layout/grid-3.typ2
-rw-r--r--tests/typ/layout/pad.typ2
-rw-r--r--tests/typ/layout/par-bidi.typ2
-rw-r--r--tests/typ/layout/par-indent.typ4
-rw-r--r--tests/typ/layout/place-background.typ2
-rw-r--r--tests/typ/layout/place.typ2
-rw-r--r--tests/typ/layout/transform.typ4
-rw-r--r--tests/typ/meta/link.typ2
-rw-r--r--tests/typ/visualize/image.typ28
58 files changed, 75 insertions, 71 deletions
diff --git a/NOTICE b/NOTICE
index 05dccbcd..d1f488b8 100644
--- a/NOTICE
+++ b/NOTICE
@@ -65,19 +65,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
The SIL Open Font License Version 1.1 applies to:
-* IBM Plex fonts in tests/fonts/IBMPlex*.ttf
+* IBM Plex fonts in assets/fonts/IBMPlex*.ttf
Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"
(https://github.com/IBM/plex)
-* Noto fonts in tests/fonts/Noto*.ttf
+* Noto fonts in assets/fonts/Noto*.ttf
Copyright 2018 The Noto Project Authors
(https://github.com/googlei18n/noto-fonts)
-* PT Sans fonts in tests/fonts/PTSans*.ttf
+* PT Sans fonts in assets/fonts/PTSans*.ttf
Copyright (c) 2010, ParaType Ltd. (http://www.paratype.com/public),
with Reserved Font Names "PT Sans" and "ParaType".
-* Fira math fonts in tests/fonts/FiraMath*.otf
+* Fira math fonts in assets/fonts/FiraMath*.otf
Copyright (C) 2018--2021 by Xiangdong Zeng <xdzeng96@gmail.com>
(https://github.com/firamath/firamath)
@@ -172,7 +172,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
================================================================================
The Apache License Version 2.0 applies to:
-* Roboto fonts in tests/fonts/Roboto*.ttf
+* Roboto fonts in assets/fonts/Roboto*.ttf
(https://github.com/googlefonts/roboto)
Apache License
@@ -356,7 +356,7 @@ The Apache License Version 2.0 applies to:
================================================================================
The Ubuntu Font License Version 1.0 applies to:
-* Ubuntu fonts in tests/fonts/Ubuntu*.ttf
+* Ubuntu fonts in assets/fonts/Ubuntu*.ttf
(https://design.ubuntu.com/font/)
-------------------------------
@@ -461,10 +461,10 @@ DEALINGS IN THE FONT SOFTWARE.
================================================================================
The GUST Font License Version 1.0 applies to:
-* Latin Modern fonts in tests/fonts/LatinModern*.otf
+* Latin Modern fonts in assets/fonts/LatinModern*.otf
(http://www.gust.org.pl/projects/e-foundry/lm-math)
-* NewComputerModern fonts in tests/fonts/NewCM*.otf
+* NewComputerModern fonts in assets/fonts/NewCM*.otf
% This is version 1.0, dated 22 June 2009, of the GUST Font License.
% (GUST is the Polish TeX Users Group, http://www.gust.org.pl)
@@ -499,7 +499,7 @@ The GUST Font License Version 1.0 applies to:
================================================================================
The Creative Commons Attribution 4.0 International License applies to:
-* Twitter Color Emoji font in tests/fonts/TwitterColorEmoji.ttf
+* Twitter Color Emoji font in assets/fonts/TwitterColorEmoji.ttf
Copyright 2016 Brad Erickson
Copyright 2016 Twitter, Inc.
(https://github.com/eosrei/twemoji-color-font)
@@ -509,7 +509,7 @@ The Creative Commons Attribution 4.0 International License applies to:
Copyright 2020 Twitter, Inc and other contributors
(https://github.com/twitter/twemoji)
-* Monkey emoji in tests/res/monkey.svg
+* Monkey emoji in assets/files/monkey.svg
Copyright 2018 Vincent Le Moign, Streamline Emoji Project
Via Wikimedia Commons
(https://commons.wikimedia.org/wiki/File:440-monkey.svg)
diff --git a/tests/res/bad.csv b/assets/files/bad.csv
index 2c2696e9..2c2696e9 100644
--- a/tests/res/bad.csv
+++ b/assets/files/bad.csv
diff --git a/tests/res/bad.json b/assets/files/bad.json
index cd5d0366..cd5d0366 100644
--- a/tests/res/bad.json
+++ b/assets/files/bad.json
diff --git a/tests/res/bad.svg b/assets/files/bad.svg
index b7828a61..b7828a61 100644
--- a/tests/res/bad.svg
+++ b/assets/files/bad.svg
diff --git a/tests/res/bad.xml b/assets/files/bad.xml
index 7fa6a6ed..7fa6a6ed 100644
--- a/tests/res/bad.xml
+++ b/assets/files/bad.xml
diff --git a/tests/res/data.xml b/assets/files/data.xml
index 9ae409ee..9ae409ee 100644
--- a/tests/res/data.xml
+++ b/assets/files/data.xml
diff --git a/tests/res/graph.png b/assets/files/graph.png
index 069b0cbc..069b0cbc 100644
--- a/tests/res/graph.png
+++ b/assets/files/graph.png
Binary files differ
diff --git a/tests/res/hello.txt b/assets/files/hello.txt
index 5dd01c17..5dd01c17 100644
--- a/tests/res/hello.txt
+++ b/assets/files/hello.txt
diff --git a/tests/res/invalid-utf8.txt b/assets/files/invalid-utf8.txt
index 71308112..71308112 100644
--- a/tests/res/invalid-utf8.txt
+++ b/assets/files/invalid-utf8.txt
Binary files differ
diff --git a/tests/res/monkey.svg b/assets/files/monkey.svg
index 0e8c1124..0e8c1124 100644
--- a/tests/res/monkey.svg
+++ b/assets/files/monkey.svg
diff --git a/tests/res/pattern.svg b/assets/files/pattern.svg
index 0a46c0b6..0a46c0b6 100644
--- a/tests/res/pattern.svg
+++ b/assets/files/pattern.svg
diff --git a/tests/res/rhino.png b/assets/files/rhino.png
index f9d47dd3..f9d47dd3 100644
--- a/tests/res/rhino.png
+++ b/assets/files/rhino.png
Binary files differ
diff --git a/tests/res/tiger.jpg b/assets/files/tiger.jpg
index 74dc5e0b..74dc5e0b 100644
--- a/tests/res/tiger.jpg
+++ b/assets/files/tiger.jpg
Binary files differ
diff --git a/tests/res/zoo.csv b/assets/files/zoo.csv
index 42ff06c7..42ff06c7 100644
--- a/tests/res/zoo.csv
+++ b/assets/files/zoo.csv
diff --git a/tests/res/zoo.json b/assets/files/zoo.json
index 3b5a7ffc..3b5a7ffc 100644
--- a/tests/res/zoo.json
+++ b/assets/files/zoo.json
diff --git a/tests/fonts/FiraMath-Regular.otf b/assets/fonts/FiraMath-Regular.otf
index f1f9d40c..f1f9d40c 100644
--- a/tests/fonts/FiraMath-Regular.otf
+++ b/assets/fonts/FiraMath-Regular.otf
Binary files differ
diff --git a/tests/fonts/IBMPlexMono-Bold.ttf b/assets/fonts/IBMPlexMono-Bold.ttf
index 2ad2fa1d..2ad2fa1d 100644
--- a/tests/fonts/IBMPlexMono-Bold.ttf
+++ b/assets/fonts/IBMPlexMono-Bold.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexMono-Regular.ttf b/assets/fonts/IBMPlexMono-Regular.ttf
index ef3bc4b3..ef3bc4b3 100644
--- a/tests/fonts/IBMPlexMono-Regular.ttf
+++ b/assets/fonts/IBMPlexMono-Regular.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSans-Bold.ttf b/assets/fonts/IBMPlexSans-Bold.ttf
index 0e9eb07b..0e9eb07b 100644
--- a/tests/fonts/IBMPlexSans-Bold.ttf
+++ b/assets/fonts/IBMPlexSans-Bold.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSans-BoldItalic.ttf b/assets/fonts/IBMPlexSans-BoldItalic.ttf
index 07f8bc87..07f8bc87 100644
--- a/tests/fonts/IBMPlexSans-BoldItalic.ttf
+++ b/assets/fonts/IBMPlexSans-BoldItalic.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSans-Italic.ttf b/assets/fonts/IBMPlexSans-Italic.ttf
index 9ef096fe..9ef096fe 100644
--- a/tests/fonts/IBMPlexSans-Italic.ttf
+++ b/assets/fonts/IBMPlexSans-Italic.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSans-Medium.ttf b/assets/fonts/IBMPlexSans-Medium.ttf
index 9395402b..9395402b 100644
--- a/tests/fonts/IBMPlexSans-Medium.ttf
+++ b/assets/fonts/IBMPlexSans-Medium.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSans-Regular.ttf b/assets/fonts/IBMPlexSans-Regular.ttf
index f1c3da2f..f1c3da2f 100644
--- a/tests/fonts/IBMPlexSans-Regular.ttf
+++ b/assets/fonts/IBMPlexSans-Regular.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSansDevanagari-Regular.ttf b/assets/fonts/IBMPlexSansDevanagari-Regular.ttf
index 5d7c8f0f..5d7c8f0f 100644
--- a/tests/fonts/IBMPlexSansDevanagari-Regular.ttf
+++ b/assets/fonts/IBMPlexSansDevanagari-Regular.ttf
Binary files differ
diff --git a/tests/fonts/IBMPlexSerif-Regular.ttf b/assets/fonts/IBMPlexSerif-Regular.ttf
index 7d6dc5c1..7d6dc5c1 100644
--- a/tests/fonts/IBMPlexSerif-Regular.ttf
+++ b/assets/fonts/IBMPlexSerif-Regular.ttf
Binary files differ
diff --git a/tests/fonts/LatinModernRoman-Bold.otf b/assets/fonts/LatinModernRoman-Bold.otf
index 7d6afa73..7d6afa73 100644
--- a/tests/fonts/LatinModernRoman-Bold.otf
+++ b/assets/fonts/LatinModernRoman-Bold.otf
Binary files differ
diff --git a/tests/fonts/LatinModernRoman-Regular.otf b/assets/fonts/LatinModernRoman-Regular.otf
index 6a96b468..6a96b468 100644
--- a/tests/fonts/LatinModernRoman-Regular.otf
+++ b/assets/fonts/LatinModernRoman-Regular.otf
Binary files differ
diff --git a/tests/fonts/NewCMMath-Regular.otf b/assets/fonts/NewCMMath-Regular.otf
index 82221fb8..82221fb8 100644
--- a/tests/fonts/NewCMMath-Regular.otf
+++ b/assets/fonts/NewCMMath-Regular.otf
Binary files differ
diff --git a/tests/fonts/NotoColorEmoji.ttf b/assets/fonts/NotoColorEmoji.ttf
index 2c1f1043..2c1f1043 100644
--- a/tests/fonts/NotoColorEmoji.ttf
+++ b/assets/fonts/NotoColorEmoji.ttf
Binary files differ
diff --git a/tests/fonts/NotoSansArabic-Regular.ttf b/assets/fonts/NotoSansArabic-Regular.ttf
index 94eead4c..94eead4c 100644
--- a/tests/fonts/NotoSansArabic-Regular.ttf
+++ b/assets/fonts/NotoSansArabic-Regular.ttf
Binary files differ
diff --git a/tests/fonts/NotoSansSymbols2-Regular.ttf b/assets/fonts/NotoSansSymbols2-Regular.ttf
index 429a51d5..429a51d5 100644
--- a/tests/fonts/NotoSansSymbols2-Regular.ttf
+++ b/assets/fonts/NotoSansSymbols2-Regular.ttf
Binary files differ
diff --git a/tests/fonts/NotoSerifCJKsc-Regular.otf b/assets/fonts/NotoSerifCJKsc-Regular.otf
index 4c5f715b..4c5f715b 100644
--- a/tests/fonts/NotoSerifCJKsc-Regular.otf
+++ b/assets/fonts/NotoSerifCJKsc-Regular.otf
Binary files differ
diff --git a/tests/fonts/NotoSerifHebrew-Bold.ttf b/assets/fonts/NotoSerifHebrew-Bold.ttf
index e7cbd93a..e7cbd93a 100644
--- a/tests/fonts/NotoSerifHebrew-Bold.ttf
+++ b/assets/fonts/NotoSerifHebrew-Bold.ttf
Binary files differ
diff --git a/tests/fonts/NotoSerifHebrew-Regular.ttf b/assets/fonts/NotoSerifHebrew-Regular.ttf
index 27893f10..27893f10 100644
--- a/tests/fonts/NotoSerifHebrew-Regular.ttf
+++ b/assets/fonts/NotoSerifHebrew-Regular.ttf
Binary files differ
diff --git a/tests/fonts/PTSans-Regular.ttf b/assets/fonts/PTSans-Regular.ttf
index 5222968f..5222968f 100644
--- a/tests/fonts/PTSans-Regular.ttf
+++ b/assets/fonts/PTSans-Regular.ttf
Binary files differ
diff --git a/tests/fonts/Roboto-Regular.ttf b/assets/fonts/Roboto-Regular.ttf
index 500b1045..500b1045 100644
--- a/tests/fonts/Roboto-Regular.ttf
+++ b/assets/fonts/Roboto-Regular.ttf
Binary files differ
diff --git a/tests/fonts/TwitterColorEmoji.ttf b/assets/fonts/TwitterColorEmoji.ttf
index a8f829ac..a8f829ac 100644
--- a/tests/fonts/TwitterColorEmoji.ttf
+++ b/assets/fonts/TwitterColorEmoji.ttf
Binary files differ
diff --git a/tests/fonts/Ubuntu-Regular.ttf b/assets/fonts/Ubuntu-Regular.ttf
index f98a2dab..f98a2dab 100644
--- a/tests/fonts/Ubuntu-Regular.ttf
+++ b/assets/fonts/Ubuntu-Regular.ttf
Binary files differ
diff --git a/src/lib.rs b/src/lib.rs
index 4d4cbb8b..0dc42152 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -75,7 +75,11 @@ pub fn compile(world: &(dyn World + 'static), source: &Source) -> SourceResult<D
#[comemo::track]
pub trait World {
/// The path relative to which absolute paths are.
- fn root(&self) -> &Path;
+ ///
+ /// Defaults to the empty path.
+ fn root(&self) -> &Path {
+ Path::new("")
+ }
/// The standard library.
fn library(&self) -> &Prehashed<Library>;
diff --git a/tests/README.md b/tests/README.md
index 5356cf65..d57b770c 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -10,8 +10,6 @@ Top level directory structure:
a test passed or failed.
- `png`: PNG files produced by tests.
- `pdf`: PDF files produced by tests.
-- `res`: Resource files used by tests.
-- `fonts`: Font files used for tests.
## Running the tests
Running all tests (including unit tests):
diff --git a/tests/src/benches.rs b/tests/src/benches.rs
index 997d3b40..50324c78 100644
--- a/tests/src/benches.rs
+++ b/tests/src/benches.rs
@@ -11,7 +11,7 @@ use typst::World;
use unscanny::Scanner;
const TEXT: &str = include_str!("../typ/compiler/bench.typ");
-const FONT: &[u8] = include_bytes!("../fonts/IBMPlexSans-Regular.ttf");
+const FONT: &[u8] = include_bytes!("../../assets/fonts/IBMPlexSans-Regular.ttf");
main!(
bench_decode,
@@ -124,10 +124,6 @@ impl BenchWorld {
}
impl World for BenchWorld {
- fn root(&self) -> &Path {
- Path::new("")
- }
-
fn library(&self) -> &Prehashed<Library> {
&self.library
}
diff --git a/tests/src/tests.rs b/tests/src/tests.rs
index 7cb1041f..b90abcee 100644
--- a/tests/src/tests.rs
+++ b/tests/src/tests.rs
@@ -28,7 +28,8 @@ const TYP_DIR: &str = "typ";
const REF_DIR: &str = "ref";
const PNG_DIR: &str = "png";
const PDF_DIR: &str = "pdf";
-const FONT_DIR: &str = "fonts";
+const FONT_DIR: &str = "../assets/fonts";
+const FILE_DIR: &str = "../assets/files";
fn main() {
let args = Args::new(env::args().skip(1));
@@ -240,7 +241,7 @@ impl TestWorld {
impl World for TestWorld {
fn root(&self) -> &Path {
- Path::new("")
+ Path::new(FILE_DIR)
}
fn library(&self) -> &Prehashed<Library> {
@@ -306,10 +307,15 @@ impl TestWorld {
}
}
-/// Read a file.
+/// Read as file.
fn read(path: &Path) -> FileResult<Vec<u8>> {
- let f = |e| FileError::from_io(e, path);
- let mut file = File::open(path).map_err(f)?;
+ let suffix = path
+ .strip_prefix(FILE_DIR)
+ .map(|suffix| Path::new("/").join(suffix))
+ .unwrap_or_else(|_| path.into());
+
+ let f = |e| FileError::from_io(e, &suffix);
+ let mut file = File::open(&path).map_err(f)?;
if file.metadata().map_err(f)?.is_file() {
let mut data = vec![];
file.read_to_end(&mut data).map_err(f)?;
diff --git a/tests/typ/coma.typ b/tests/typ/coma.typ
index 3ce86940..7ec2c410 100644
--- a/tests/typ/coma.typ
+++ b/tests/typ/coma.typ
@@ -21,4 +21,4 @@ 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.
-#align(center, image("../res/graph.png", width: 75%))
+#align(center, image("/graph.png", width: 75%))
diff --git a/tests/typ/compiler/import.typ b/tests/typ/compiler/import.typ
index f97b1ae0..0d40e351 100644
--- a/tests/typ/compiler/import.typ
+++ b/tests/typ/compiler/import.typ
@@ -69,8 +69,8 @@
---
// Some non-text stuff.
-// Error: 9-30 file is not valid utf-8
-#import "../../res/rhino.png"
+// Error: 9-21 file is not valid utf-8
+#import "/rhino.png"
---
// Unresolved import.
diff --git a/tests/typ/compiler/include.typ b/tests/typ/compiler/include.typ
index a655e9f2..fa2e84c0 100644
--- a/tests/typ/compiler/include.typ
+++ b/tests/typ/compiler/include.typ
@@ -6,7 +6,7 @@
= Document
// Include a file
-#include "/typ/compiler/modules/chap1.typ"
+#include "modules/chap1.typ"
// Expression as a file name.
#let chap2 = include "modu" + "les/chap" + "2.typ"
diff --git a/tests/typ/compiler/set.typ b/tests/typ/compiler/set.typ
index 39c3e613..36a42745 100644
--- a/tests/typ/compiler/set.typ
+++ b/tests/typ/compiler/set.typ
@@ -40,7 +40,7 @@ Hello *#x*
// Test relative path resolving in layout phase.
#let choice = ("monkey.svg", "rhino.png", "tiger.jpg")
#set enum(numbering: n => {
- let path = "../../res/" + choice.at(n - 1)
+ let path = "/" + choice.at(n - 1)
move(dy: -0.15em, image(path, width: 1em, height: 1em))
})
diff --git a/tests/typ/compiler/show-text.typ b/tests/typ/compiler/show-text.typ
index 124d2ed2..c867ff9f 100644
--- a/tests/typ/compiler/show-text.typ
+++ b/tests/typ/compiler/show-text.typ
@@ -54,6 +54,6 @@ World
---
// Test absolute path in layout phase.
-#show "GRAPH": image("/res/graph.png")
+#show "GRAPH": image("/graph.png")
The GRAPH has nodes.
diff --git a/tests/typ/compute/data.typ b/tests/typ/compute/data.typ
index dc563022..d80d4857 100644
--- a/tests/typ/compute/data.typ
+++ b/tests/typ/compute/data.typ
@@ -3,22 +3,22 @@
---
// Test reading plain text files
-#let data = read("../../res/hello.txt")
+#let data = read("/hello.txt")
#test(data, "Hello, world!")
---
-// Error: 18-41 file not found (searched at res/missing.txt)
-#let data = read("../../res/missing.txt")
+// Error: 18-32 file not found (searched at /missing.txt)
+#let data = read("/missing.txt")
---
-// Error: 18-46 file is not valid utf-8
-#let data = read("../../res/invalid-utf8.txt")
+// Error: 18-37 file is not valid utf-8
+#let data = read("/invalid-utf8.txt")
---
// Test reading CSV data.
// Ref: true
#set page(width: auto)
-#let data = csv("/res/zoo.csv")
+#let data = csv("/zoo.csv")
#let cells = data.at(0).map(strong) + data.slice(1).flatten()
#table(columns: data.at(0).len(), ..cells)
@@ -27,23 +27,23 @@
#csv("nope.csv")
---
-// Error: 6-20 failed to parse csv file: found 3 instead of 2 fields in line 3
-#csv("/res/bad.csv")
+// Error: 6-16 failed to parse csv file: found 3 instead of 2 fields in line 3
+#csv("/bad.csv")
---
// Test reading JSON data.
-#let data = json("/res/zoo.json")
+#let data = json("/zoo.json")
#test(data.len(), 3)
#test(data.at(0).name, "Debby")
#test(data.at(2).weight, 150)
---
-// Error: 7-22 failed to parse json file: syntax error in line 3
-#json("/res/bad.json")
+// Error: 7-18 failed to parse json file: syntax error in line 3
+#json("/bad.json")
---
// Test reading XML data.
-#let data = xml("/res/data.xml")
+#let data = xml("/data.xml")
#test(data, ((
tag: "data",
attrs: (:),
@@ -67,5 +67,5 @@
),))
---
-// Error: 6-20 failed to parse xml file: found closing tag 'data' instead of 'hello' in line 3
-#xml("/res/bad.xml")
+// Error: 6-16 failed to parse xml file: found closing tag 'data' instead of 'hello' in line 3
+#xml("/bad.xml")
diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ
index 1b2ab473..602bc22d 100644
--- a/tests/typ/compute/foundations.typ
+++ b/tests/typ/compute/foundations.typ
@@ -51,15 +51,15 @@ Blue #move(dy: -0.15em)[🌊]
#eval("#include \"../coma.typ\"")
---
-// Error: 7-35 cannot access file system from here
-#eval("#image(\"/res/tiger.jpg\")")
+// Error: 7-31 cannot access file system from here
+#eval("#image(\"/tiger.jpg\")")
---
// Error: 23-30 cannot access file system from here
#show raw: it => eval(it.text)
```
-#image("/res/tiger.jpg")
+#image("/tiger.jpg")
```
---
@@ -67,7 +67,7 @@ Blue #move(dy: -0.15em)[🌊]
#show raw: it => eval(it.text)
```
-#show emph: _ => image("../../res/giraffe.jpg")
+#show emph: _ => image("/giraffe.jpg")
_No relative giraffe!_
```
diff --git a/tests/typ/layout/grid-3.typ b/tests/typ/layout/grid-3.typ
index 8194da73..ee79f2fd 100644
--- a/tests/typ/layout/grid-3.typ
+++ b/tests/typ/layout/grid-3.typ
@@ -23,7 +23,7 @@
columns: 4 * (1fr,),
row-gutter: 10pt,
column-gutter: (0pt, 10%),
- align(top, image("/res/rhino.png")),
+ align(top, image("/rhino.png")),
align(top, rect(inset: 0pt, fill: eastern, align(right)[LoL])),
[rofl],
[\ A] * 3,
diff --git a/tests/typ/layout/pad.typ b/tests/typ/layout/pad.typ
index 4f481502..2cc4d4ee 100644
--- a/tests/typ/layout/pad.typ
+++ b/tests/typ/layout/pad.typ
@@ -22,7 +22,7 @@ Hi #box(pad(left: 10pt)[A]) there
// Test that the pad node doesn't consume the whole region.
#set page(height: 6cm)
#align(left)[Before]
-#pad(10pt, image("/res/tiger.jpg"))
+#pad(10pt, image("/tiger.jpg"))
#align(right)[After]
---
diff --git a/tests/typ/layout/par-bidi.typ b/tests/typ/layout/par-bidi.typ
index 4baefcd3..31e3fded 100644
--- a/tests/typ/layout/par-bidi.typ
+++ b/tests/typ/layout/par-bidi.typ
@@ -43,7 +43,7 @@ Lריווח #h(1cm) R
---
// Test inline object.
#set text(lang: "he", "IBM Plex Serif")
-קרנפיםRh#image("/res/rhino.png", height: 11pt)inoחיים
+קרנפיםRh#image("/rhino.png", height: 11pt)inoחיים
---
// Test whether L1 whitespace resetting destroys stuff.
diff --git a/tests/typ/layout/par-indent.typ b/tests/typ/layout/par-indent.typ
index 8454dda5..d328da41 100644
--- a/tests/typ/layout/par-indent.typ
+++ b/tests/typ/layout/par-indent.typ
@@ -9,10 +9,10 @@ The first paragraph has no indent.
But the second one does.
-#image("/res/tiger.jpg", height: 6pt)
+#image("/tiger.jpg", height: 6pt)
starts a paragraph without indent.
-#align(center, image("/res/rhino.png", width: 1cm))
+#align(center, image("/rhino.png", width: 1cm))
= Headings
- And lists.
diff --git a/tests/typ/layout/place-background.typ b/tests/typ/layout/place-background.typ
index fafedec1..6f480b93 100644
--- a/tests/typ/layout/place-background.typ
+++ b/tests/typ/layout/place-background.typ
@@ -7,7 +7,7 @@
dx: -10pt,
dy: -10pt,
image(
- "/res/tiger.jpg",
+ "/tiger.jpg",
fit: "cover",
width: 100% + 20pt,
height: 100% + 20pt,
diff --git a/tests/typ/layout/place.typ b/tests/typ/layout/place.typ
index 58f9d06d..18f7642d 100644
--- a/tests/typ/layout/place.typ
+++ b/tests/typ/layout/place.typ
@@ -5,7 +5,7 @@
#place(bottom + center)[© Typst]
= Placement
-#place(right, image("/res/tiger.jpg", width: 1.8cm))
+#place(right, image("/tiger.jpg", width: 1.8cm))
Hi there. This is \
a placed node. \
Unfortunately, \
diff --git a/tests/typ/layout/transform.typ b/tests/typ/layout/transform.typ
index 58a053e9..cc7494b3 100644
--- a/tests/typ/layout/transform.typ
+++ b/tests/typ/layout/transform.typ
@@ -31,13 +31,13 @@ nor #xetex!
// Test combination of scaling and rotation.
#set page(height: 80pt)
#align(center + horizon,
- rotate(20deg, scale(70%, image("/res/tiger.jpg")))
+ rotate(20deg, scale(70%, image("/tiger.jpg")))
)
---
// Test setting rotation origin.
#rotate(10deg, origin: top + left,
- image("/res/tiger.jpg", width: 50%)
+ image("/tiger.jpg", width: 50%)
)
---
diff --git a/tests/typ/meta/link.typ b/tests/typ/meta/link.typ
index 8c3e6ddd..4ed7e58d 100644
--- a/tests/typ/meta/link.typ
+++ b/tests/typ/meta/link.typ
@@ -38,7 +38,7 @@ My cool #move(dx: 0.7cm, dy: 0.7cm, rotate(10deg, scale(200%, mylink)))
// Link containing a block.
#link("https://example.com/", block[
My cool rhino
- #move(dx: 10pt, image("/res/rhino.png", width: 1cm))
+ #move(dx: 10pt, image("/rhino.png", width: 1cm))
])
---
diff --git a/tests/typ/visualize/image.typ b/tests/typ/visualize/image.typ
index 6a2c37e1..89381955 100644
--- a/tests/typ/visualize/image.typ
+++ b/tests/typ/visualize/image.typ
@@ -4,24 +4,24 @@
// Test loading different image formats.
// Load an RGBA PNG image.
-#image("/res/rhino.png")
+#image("/rhino.png")
// Load an RGB JPEG image.
#set page(height: 60pt)
-#image("../../res/tiger.jpg")
+#image("/tiger.jpg")
---
// Test configuring the size and fitting behaviour of images.
// Set width and height explicitly.
-#image("/res/rhino.png", width: 30pt)
-#image("/res/rhino.png", height: 30pt)
+#image("/rhino.png", width: 30pt)
+#image("/rhino.png", height: 30pt)
// Set width and height explicitly and force stretching.
-#image("/res/monkey.svg", width: 100%, height: 20pt, fit: "stretch")
+#image("/monkey.svg", width: 100%, height: 20pt, fit: "stretch")
// Make sure the bounding-box of the image is correct.
-#align(bottom + right, image("/res/tiger.jpg", width: 40pt))
+#align(bottom + right, image("/tiger.jpg", width: 40pt))
---
// Test all three fit modes.
@@ -30,9 +30,9 @@
columns: (1fr, 1fr, 1fr),
rows: 100%,
gutter: 3pt,
- image("/res/tiger.jpg", width: 100%, height: 100%, fit: "contain"),
- image("/res/tiger.jpg", width: 100%, height: 100%, fit: "cover"),
- image("/res/monkey.svg", width: 100%, height: 100%, fit: "stretch"),
+ image("/tiger.jpg", width: 100%, height: 100%, fit: "contain"),
+ image("/tiger.jpg", width: 100%, height: 100%, fit: "cover"),
+ image("/monkey.svg", width: 100%, height: 100%, fit: "stretch"),
)
---
@@ -40,15 +40,15 @@
#set page(height: 60pt)
Stuff #parbreak()
Stuff
-#image("/res/rhino.png")
+#image("/rhino.png")
---
// Test baseline.
-A #image("/res/tiger.jpg", height: 1cm, width: 80%) B
+A #image("/tiger.jpg", height: 1cm, width: 80%) B
---
// Test advanced SVG features.
-#image("/res/pattern.svg")
+#image("/pattern.svg")
---
// Error: 8-29 file not found (searched at typ/visualize/path/does/not/exist)
@@ -59,5 +59,5 @@ A #image("/res/tiger.jpg", height: 1cm, width: 80%) B
#image("./image.typ")
---
-// Error: 8-22 failed to parse svg: found closing tag 'g' instead of 'style' in line 4
-#image("/res/bad.svg")
+// Error: 8-18 failed to parse svg: found closing tag 'g' instead of 'style' in line 4
+#image("/bad.svg")