summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/lib.rs b/src/lib.rs
index cb4be8b4..26543b1d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -136,56 +136,3 @@ error_type! {
from: (ParseError, TypesetError::Parse(err)),
from: (LayoutError, TypesetError::Layout(err)),
}
-
-
-#[cfg(test)]
-mod test {
- use std::fs::File;
- use std::io::BufWriter;
- use crate::Typesetter;
- use crate::export::pdf::PdfExporter;
- use toddle::query::FileSystemFontProvider;
-
- /// Create a _PDF_ with a name from the source code.
- fn test(name: &str, src: &str) {
- let mut typesetter = Typesetter::new();
- let provider = FileSystemFontProvider::from_listing("fonts/fonts.toml").unwrap();
- typesetter.add_font_provider(provider);
-
- // Typeset into document.
- let document = typesetter.typeset(src).unwrap();
-
- // Write to file.
- let path = format!("../target/typeset-unit-{}.pdf", name);
- let file = BufWriter::new(File::create(path).unwrap());
- let exporter = PdfExporter::new();
- exporter.export(&document, typesetter.loader(), file).unwrap();
- }
-
- #[test]
- fn features() {
- test("features", r"
- *Features Test Page*
-
- _Multiline:_
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
- eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
- voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
- clita kasd gubergren, no sea takimata sanctus est.
-
- _Emoji:_ Hello World! 🌍
-
- _Styles:_ This is made *bold*, that _italic_ and this one `monospace` using the
- built-in syntax!
-
- _Styles with functions:_ This [bold][word] is made bold and [italic][that] is italic
- using the standard library functions [mono][bold] and `italic`!
- ");
- }
-
- #[test]
- fn shakespeare() {
- test("shakespeare", include_str!("../test/shakespeare.tps"));
- test("shakespeare-right", &format!("[align:right][{}]", include_str!("../test/shakespeare.tps")));
- }
-}