List figures and tables from their numbered captions
This commit is contained in:
1 parent
b2f5b67b07
commit
8955babea8
5 files changed
+127
-4
No files matched your search
@@ -343,6 +343,31 @@ fn project_preview_expands_local_style_packages() {
|
||||
assert!(!text.contains("ProvidesPackage"), "{text}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn route_d_renders_float_lists() {
|
||||
let server = TestServer::start("route-d-float-lists");
|
||||
let source = "\\documentclass{article}\n\\begin{document}\n\\listoffigures\n\n\\listoftables\n\n\\begin{figure}\n\\caption{Plot}\n\\end{figure}\n\n\\begin{table}\n\\begin{tabular}{l}\nA\n\\end{tabular}\n\\caption{Numbers}\n\\end{table}\n\\end{document}";
|
||||
let put = server.request(
|
||||
"PUT",
|
||||
"/api/projects/hello/file?path=hello.tex",
|
||||
source.as_bytes(),
|
||||
"text/plain; charset=utf-8",
|
||||
);
|
||||
assert_eq!(put.status, 200, "{}", put.text());
|
||||
let preview = server.request(
|
||||
"POST",
|
||||
"/api/projects/hello/preview?engine=route-d",
|
||||
&[],
|
||||
"application/json",
|
||||
);
|
||||
assert_eq!(preview.status, 200, "{}", preview.text());
|
||||
let text = preview.text();
|
||||
assert_eq!(text.matches(">P</text>").count(), 2, "{text}");
|
||||
assert_eq!(text.matches(">N</text>").count(), 2, "{text}");
|
||||
assert!(!text.contains("texrralof"), "{text}");
|
||||
assert!(!text.contains("texrralot"), "{text}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn route_d_renders_a_table_of_contents() {
|
||||
let server = TestServer::start("route-d-toc");
|
||||
|
||||
Reference in new issue
Block a user