Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/extend-zi/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#set page(width: auto, height: auto, margin: .5em)


$1#sym.space.thin"fs"$ \
$1#sym.space.thin"µZero"$ \
Binary file removed tests/extend-zi/ref/1.png
Binary file not shown.
5 changes: 2 additions & 3 deletions tests/extend-zi/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#set page(width: auto, height: auto, margin: .5em)
#import "zi.typ"

#zi.fs[1]

#zi.µZ[1]
#zi.fs[1] \
#zi.µZ[1] \
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/num/digits/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#set page(width: auto, height: auto, margin: 2pt)


$1.23$ \
$1.20$ \
$1$ \
$3$ \
$-1.23$ \
$-1.20$ \
10 changes: 10 additions & 0 deletions tests/num/digits/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)


#num("1.234", digits: 2) \
#num("1.2", digits: 2) \
#num("1.234", digits: 0) \
#num("3.2", digits: 0) \
#num("-1.234", digits: 2) \
#num("-1.2", digits: 2) \
5 changes: 5 additions & 0 deletions tests/num/grouping/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
19 changes: 19 additions & 0 deletions tests/num/grouping/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#set page(width: auto, height: auto, margin: 2pt)

#let th = sym.space.thin


$10.10$ \
$123.321$ \
$1234.4321$ \
$12th 345.543th 21$ \
$1th 234th 567$ \
$1234567$ \
$1th 234.432th 1$ \
$1"'"23"'"45.54"'"32"'"1$ \

#pagebreak()

$23th 232.2323$ \
$23232.232th 3$ \
$23th 232.2323$ \
34 changes: 34 additions & 0 deletions tests/num/grouping/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)



#num("10.10") \
#num("123.321") \
#num("1234.4321") \
#num("12345.54321") \
#num("1234567") \
#set-group(threshold: calc.inf)
#num("1234567") \
#set-group(threshold: 3)
#num("1234.4321") \
#set-group(separator: "'", size: 2)
#num("12345.54321") \
#set-group(separator: sym.space.thin, size: 3, threshold: 5)


#pagebreak()

// Asymmetric thresholds
#num(
group: (threshold: (fractional: 5, integer: 3)),
[23232.2323],
) \
#num(
group: (threshold: (fractional: 3, integer: calc.inf)),
[23232.2323],
) \
#num(
group: (threshold: (integer: 3, fractional: calc.inf)),
[23232.2323],
)
1 change: 0 additions & 1 deletion tests/num/identical/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions tests/num/identical/ref.typ

This file was deleted.

15 changes: 0 additions & 15 deletions tests/num/identical/test.typ

This file was deleted.

20 changes: 18 additions & 2 deletions tests/num/input-formats/ref.typ
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)


$0$ \
$-0$ \
$-2.23$ \
$-2.23$ \
$-2.23$ \
$-2.23$ \
$-2.23$ \
$-112.3$ \
$23×10^2$

#pagebreak()

$0.1$ \
$0.1$ \
$2×10^(-1.2)$ \

#pagebreak()

$1$ $2$

#pagebreak()

$+1$ $+2$
35 changes: 34 additions & 1 deletion tests/num/input-formats/test.typ
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)


#num[0] \
#num[-0] \
#num[-2.23] \
#num[-2,23] \
#num(-2.23) \
#num("-2.23") \
#num("-2,23") \
#num((mantissa: "-112.3", e: none, pm: none)) \
#num((mantissa: 23, e: "2", pm: none))

#pagebreak()

#num[.1] \
#num[,1] \
#num[2e-1,2] \



#pagebreak()

// Advanced input



// num with array input
#context {
num(("1", "2")).join(" ")
}

#pagebreak()

// num with state input
#context {
let state = impl.num-state.get()
state.positive-sign = true
num("1", state: state)
[ ]
num("2", state: state)
}
5 changes: 5 additions & 0 deletions tests/num/omit-unity-mantissa/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
19 changes: 19 additions & 0 deletions tests/num/omit-unity-mantissa/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#set page(width: auto, height: auto, margin: 2pt)

$1×10^9$ \
$10^9$ \
$2×10^9$ \
$(1plus.minus 1)×10^9$ \
$1$ \
$10^3$ \
$1×10^3$ \

#pagebreak()

$1.00×10^2$ \
$10^2$ \

#pagebreak()

$+10^3$ \
$-10^3$ \
28 changes: 28 additions & 0 deletions tests/num/omit-unity-mantissa/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)


#num("1e9", omit-unity-mantissa: false) \
#num("1e9", omit-unity-mantissa: true) \
#num("2e9", omit-unity-mantissa: true) \
#num("1+-1e9", omit-unity-mantissa: true) \
#num("1", omit-unity-mantissa: true) \
#set-num(omit-unity-mantissa: true)
#num("1e3") \
#set-num(omit-unity-mantissa: false)
#num("1e3") \

#pagebreak()

// not omitted because mantissa is 1.00
#num(omit-unity-mantissa: true, exponent: "sci")[100] \
// but omitted when trailing zeros are trimmed
#num(omit-unity-mantissa: true, exponent: "sci", trim-zeros: true)[100]



#pagebreak()

// combine signs and omit-unity-mantissa
#num("1e3", positive-sign: true, omit-unity-mantissa: true) \
#num("-1e3", positive-sign: true, omit-unity-mantissa: true) \
5 changes: 5 additions & 0 deletions tests/num/positive-sign-exponent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
8 changes: 8 additions & 0 deletions tests/num/positive-sign-exponent/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#set page(width: auto, height: auto, margin: 2pt)

$1×10^3$ \
$1×10^(+3)$ \
$1×10^(-1)$ \
$1×10^(-1)$ \
$1×10^(+9)$ \
$1×10^(9)$ \
12 changes: 12 additions & 0 deletions tests/num/positive-sign-exponent/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)


#num("1e3", positive-sign-exponent: false) \
#num("1e3", positive-sign-exponent: true) \
#num("1e-1", positive-sign-exponent: false) \
#num("1e-1", positive-sign-exponent: true) \
#set-num(positive-sign-exponent: true)
#num("1e9") \
#set-num(positive-sign-exponent: false)
#num("1e9")
5 changes: 5 additions & 0 deletions tests/num/positive-sign/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
8 changes: 8 additions & 0 deletions tests/num/positive-sign/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#set page(width: auto, height: auto, margin: 2pt)

$1$ \
$+1$ \
$-1$ \
$-1$ \
$+9$ \
$9$ \
14 changes: 14 additions & 0 deletions tests/num/positive-sign/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)



#num("1", positive-sign: false) \
#num("1", positive-sign: true) \
#num("-1", positive-sign: false) \
#num("-1", positive-sign: true) \
#set-num(positive-sign: true)
#num("9") \
#set-num(positive-sign: false)
#num("9") \

5 changes: 5 additions & 0 deletions tests/num/power/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
19 changes: 19 additions & 0 deletions tests/num/power/ref.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#set page(width: auto, height: auto, margin: 2pt)

$2.3×10^3$ \
$-1.1×10^(-3)$ \

#pagebreak()

$2×10^9$ \
$2·10^9$ \
$2·10^9$ \
$2×10^9$ \

#pagebreak()

$1×2^2$ \
$1×e^2$ \
$1×pi^2$ \
$1×4^2$ \
$1×10^2$ \
27 changes: 27 additions & 0 deletions tests/num/power/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#import "/src/zero.typ": *
#set page(width: auto, height: auto, margin: 2pt)

#num[2.3e3] \
#num[-1.1e-3] \

#pagebreak()

// multiplication symbol
#num("2e9") \
#num("2e9", product: math.dot) \
#set-num(product: math.dot)
#num("2e9") \
#set-num(product: math.times)
#num("2e9") \

#pagebreak()


// base
#num("1e2", base: 2) \
#num("1e2", base: $e$) \
#num("1e2", base: $π$) \
#set-num(base: "4")
#num("1e2") \
#set-num(base: 10)
#num("1e2")
5 changes: 5 additions & 0 deletions tests/num/rounding/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generated by tytanic, do not edit

/diff/
/out/
/ref/
Loading
Loading