Skip to content

Commit

Permalink
start infra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slashformotion committed Jun 19, 2024
1 parent 9454217 commit f55d66d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 23 deletions.
Binary file renamed tests/debug.pdf → tests/debug/debug.pdf
Binary file not shown.
46 changes: 23 additions & 23 deletions tests/debug.typ → tests/debug/debug.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "../themes/default.typ": *
#import "../../themes/default.typ": *

#show: make-glossary
#show link: set text(fill: red)
Expand All @@ -18,7 +18,7 @@
short: "potato@A",
plural: "potatoes@A",
description: [#lorem(5)],
group: "A"
group: "A",
),
(
key: "potato B",
Expand All @@ -27,13 +27,13 @@
plural: "potatoes@B",
longplural: "long potatoes@B",
description: [#lorem(5)],
group: "B"
group: "B",
),
(
key: "hidden potato",
short: "hiddenpotato",
group: "show-all test",
description: [This potato does not appear, unless `print-glossary` is called with `show-all: true`]
description: [This potato does not appear, unless `print-glossary` is called with `show-all: true`],
),
)
#let entry-list-2 = (
Expand All @@ -44,31 +44,31 @@
plural: "potatoes@C",
longplural: "long potatoes@C",
description: [#lorem(5)],
group: "C"
group: "C",
),
(
key: "potato D",
short: "potato@D",
long: "long potato@D",
plural: "potatoes@D",
description: [#lorem(5)],
group: "D"
group: "D",
),
(
key: "potato E",
short: "potato@E",
long: "long potato@E",
longplural: "long potatoes@E",
description: [#lorem(5)],
group: "E"
group: "E",
),
(
key: "potato F",
short: "potato@F",
long: "long potato@F",
longplural: "long potatoes@F",
description: [This potato should not appear in the document.],
group: "F"
group: "F",
),
)
#let entry-list-3 = (
Expand All @@ -78,7 +78,7 @@
long: "long potato@G",
longplural: "long potatoes@G",
description: [This potato should appear in the document.],
group: "G"
group: "G",
),
)

Expand All @@ -92,22 +92,22 @@
== entry-list-1

#entry-list-1

== entry-list-2
#entry-list-2

#colbreak()

== #repr(__normalize_entry_list) n°0

#__normalize_entry_list(entry-list-0)

== #repr(__normalize_entry_list) n°1

#__normalize_entry_list(entry-list-1)

== #repr(__normalize_entry_list) n°2

#__normalize_entry_list(entry-list-2)
]

Expand All @@ -128,21 +128,21 @@ First: #gls("potato")
Display: #gls("potato", display: "potato text")

Force long: #gls("potato", long: true)

1st ref. when long is empty defaults to short: #gls("potato A")

Force long when empty defaults to short: #gls("potato A", long: true)

2nd ref.: #gls("potato A")

1st ref.: #gls("potato B")

== #glspl

First: #glspl("potato C")

Force long: #glspl("potato", long: true)

Force long when empty defaults to plural: #glspl("potato A", long: true)

2nd ref.: #glspl("potato A")
Expand Down Expand Up @@ -177,7 +177,7 @@ Force long when empty defaults to plural: #glspl("potato A", long: true)

== `gls-longplural.with(link: true)`

#gls-longplural.with(link:true)("potato B")
#gls-longplural.with(link: true)("potato B")

== #gls-description

Expand All @@ -191,7 +191,7 @@ Force long when empty defaults to plural: #glspl("potato A", long: true)

#columns(2)[
== `#print-glossary.with(show-all: true, disable-back-references: true)`

#print-glossary(
entry-list-0,
show-all: true,
Expand All @@ -205,15 +205,15 @@ Force long when empty defaults to plural: #glspl("potato A", long: true)
)

#colbreak()

== #repr(print-glossary) (show-all: false)

#print-glossary(
entry-list-2,
show-all: false,
disable-back-references: false,
)

#print-glossary(
entry-list-3,
show-all: true,
Expand All @@ -227,4 +227,4 @@ Force long when empty defaults to plural: #glspl("potato A", long: true)

#default-print-reference.with(show-all: true)(entry-list-2.last())

]
]
Binary file added tests/non-regression/only-one-empty-group.pdf
Binary file not shown.
31 changes: 31 additions & 0 deletions tests/non-regression/only-one-empty-group.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#import "../../themes/default.typ": *
#show: make-glossary
#set page(numbering: "1")
#lorem(25)

@key1:pl
#gls("key2")

#lorem(45)

#print-glossary(
(
// (
// key: "key",
// short: "111111",
// group: "vvv"
// ),
(
key: "key2",
short: "222222",
// group: "vvv"
),

(
key: "key1",
short: "111111",
// group: "voila",
),
),
show-all: true,
)

0 comments on commit f55d66d

Please sign in to comment.