Skip to content

Commit

Permalink
fix: Don't exceed document number target.
Browse files Browse the repository at this point in the history
  • Loading branch information
wxgeo committed Dec 10, 2023
1 parent 4b9ae4f commit 07a837e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ptyx/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,11 @@ def make_files(

all_compilation_info.info_dict[doc_id] = info
doc_id = DocId(doc_id + 1)
for compil_info in pages_per_document.values():
if len(compil_info.doc_ids) > len(all_compilation_info.doc_ids):
all_compilation_info = compil_info

assert len(all_compilation_info) == target
assert len(all_compilation_info) == target, len(all_compilation_info)
filenames = all_compilation_info.pdf_paths

# Join different versions in a single pdf, and compress if asked to do so.
Expand Down
7 changes: 6 additions & 1 deletion tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ def test_EVAL_abs():
assert parse(r"$#{abs(-5)}$") == r"$5$"


def test_EVAL_underscore_in_variable_name():
def test_EVAL_variable_name():
# Underscore in variable name
assert parse("#{this_is_a_strange_name_1=3}:#this_is_a_strange_name_1") == "3:3"
assert parse("#_a") == "_a"
assert parse("#a_") == "a_{}"
# A variable name can't start with a digit
assert parse("#5_a") == "#5_a"


def test_EVAL_rounding():
Expand Down

0 comments on commit 07a837e

Please sign in to comment.