diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-05-03 10:33:18 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-05-03 10:33:18 +0200 |
| commit | ad347632ab95e29eb5180b27142f5c264dfc611a (patch) | |
| tree | 2742a33f4c3d800a86e977de04fa2cec7104c43f /tests | |
| parent | bcc014c4e177cc4e8cf5ca8c24990908b507c0f8 (diff) | |
Make ligatures copyable and searchable
Fixes #479
Fixes #1040
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/text/copy-paste.png | bin | 0 -> 3196 bytes | |||
| -rw-r--r-- | tests/ref/text/shaping.png | bin | 1467 -> 2606 bytes | |||
| -rw-r--r-- | tests/src/tests.rs | 12 | ||||
| -rw-r--r-- | tests/typ/text/copy-paste.typ | 8 |
4 files changed, 19 insertions, 1 deletions
diff --git a/tests/ref/text/copy-paste.png b/tests/ref/text/copy-paste.png Binary files differnew file mode 100644 index 00000000..cbbad940 --- /dev/null +++ b/tests/ref/text/copy-paste.png diff --git a/tests/ref/text/shaping.png b/tests/ref/text/shaping.png Binary files differindex 7b33074f..278fe8ee 100644 --- a/tests/ref/text/shaping.png +++ b/tests/ref/text/shaping.png diff --git a/tests/src/tests.rs b/tests/src/tests.rs index 0e22084c..2a0b74ea 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -353,9 +353,18 @@ fn test( pdf_path: Option<&Path>, args: &Args, ) -> bool { - let name = src_path.strip_prefix(TYP_DIR).unwrap_or(src_path); + struct PanicGuard<'a>(&'a Path); + impl Drop for PanicGuard<'_> { + fn drop(&mut self) { + if std::thread::panicking() { + println!("Panicked in {}", self.0.display()); + } + } + } + let name = src_path.strip_prefix(TYP_DIR).unwrap_or(src_path); let text = fs::read_to_string(src_path).unwrap(); + let _guard = PanicGuard(name); let mut output = String::new(); let mut ok = true; @@ -401,6 +410,7 @@ fn test( line, &mut rng, ); + ok &= part_ok; compare_ever |= compare_here; frames.extend(part_frames); diff --git a/tests/typ/text/copy-paste.typ b/tests/typ/text/copy-paste.typ new file mode 100644 index 00000000..5d826482 --- /dev/null +++ b/tests/typ/text/copy-paste.typ @@ -0,0 +1,8 @@ +// Test copy-paste and search in PDF with ligatures +// and Arabic test. Must be tested manually! + +--- +The after fira 🏳️🌈! + +#set text(lang: "ar", font: "Noto Sans Arabic") +مرحبًا |
