diff --git a/tests/ref/expr/array.png b/tests/ref/code/array.png similarity index 100% rename from tests/ref/expr/array.png rename to tests/ref/code/array.png diff --git a/tests/ref/expr/block-invalid.png b/tests/ref/code/block-invalid.png similarity index 100% rename from tests/ref/expr/block-invalid.png rename to tests/ref/code/block-invalid.png diff --git a/tests/ref/expr/block.png b/tests/ref/code/block.png similarity index 100% rename from tests/ref/expr/block.png rename to tests/ref/code/block.png diff --git a/tests/ref/expr/call-invalid.png b/tests/ref/code/call-invalid.png similarity index 100% rename from tests/ref/expr/call-invalid.png rename to tests/ref/code/call-invalid.png diff --git a/tests/ref/expr/call.png b/tests/ref/code/call.png similarity index 100% rename from tests/ref/expr/call.png rename to tests/ref/code/call.png diff --git a/tests/ref/comment.png b/tests/ref/code/comment.png similarity index 100% rename from tests/ref/comment.png rename to tests/ref/code/comment.png diff --git a/tests/ref/expr/dict.png b/tests/ref/code/dict.png similarity index 100% rename from tests/ref/expr/dict.png rename to tests/ref/code/dict.png diff --git a/tests/ref/control/for.png b/tests/ref/code/for.png similarity index 100% rename from tests/ref/control/for.png rename to tests/ref/code/for.png diff --git a/tests/ref/control/if.png b/tests/ref/code/if.png similarity index 100% rename from tests/ref/control/if.png rename to tests/ref/code/if.png diff --git a/tests/ref/control/invalid.png b/tests/ref/code/invalid.png similarity index 100% rename from tests/ref/control/invalid.png rename to tests/ref/code/invalid.png diff --git a/tests/ref/control/let.png b/tests/ref/code/let.png similarity index 100% rename from tests/ref/control/let.png rename to tests/ref/code/let.png diff --git a/tests/ref/expr/ops.png b/tests/ref/code/ops.png similarity index 100% rename from tests/ref/expr/ops.png rename to tests/ref/code/ops.png diff --git a/tests/ref/repr.png b/tests/ref/code/repr.png similarity index 100% rename from tests/ref/repr.png rename to tests/ref/code/repr.png diff --git a/tests/ref/control/while.png b/tests/ref/code/while.png similarity index 100% rename from tests/ref/control/while.png rename to tests/ref/code/while.png diff --git a/tests/ref/expand.png b/tests/ref/layout/fixed.png similarity index 100% rename from tests/ref/expand.png rename to tests/ref/layout/fixed.png diff --git a/tests/ref/spacing.png b/tests/ref/spacing.png deleted file mode 100644 index 82f7e8d23..000000000 Binary files a/tests/ref/spacing.png and /dev/null differ diff --git a/tests/ref/text/whitespace.png b/tests/ref/text/whitespace.png index 35a213206..27a67586a 100644 Binary files a/tests/ref/text/whitespace.png and b/tests/ref/text/whitespace.png differ diff --git a/tests/typ/expr/array.typ b/tests/typ/code/array.typ similarity index 100% rename from tests/typ/expr/array.typ rename to tests/typ/code/array.typ diff --git a/tests/typ/expr/assoc.typ b/tests/typ/code/assoc.typ similarity index 100% rename from tests/typ/expr/assoc.typ rename to tests/typ/code/assoc.typ diff --git a/tests/typ/expr/block-invalid.typ b/tests/typ/code/block-invalid.typ similarity index 100% rename from tests/typ/expr/block-invalid.typ rename to tests/typ/code/block-invalid.typ diff --git a/tests/typ/expr/block-scoping.typ b/tests/typ/code/block-scoping.typ similarity index 100% rename from tests/typ/expr/block-scoping.typ rename to tests/typ/code/block-scoping.typ diff --git a/tests/typ/expr/block.typ b/tests/typ/code/block.typ similarity index 100% rename from tests/typ/expr/block.typ rename to tests/typ/code/block.typ diff --git a/tests/typ/expr/call-invalid.typ b/tests/typ/code/call-invalid.typ similarity index 100% rename from tests/typ/expr/call-invalid.typ rename to tests/typ/code/call-invalid.typ diff --git a/tests/typ/expr/call.typ b/tests/typ/code/call.typ similarity index 100% rename from tests/typ/expr/call.typ rename to tests/typ/code/call.typ diff --git a/tests/typ/expr/closure.typ b/tests/typ/code/closure.typ similarity index 100% rename from tests/typ/expr/closure.typ rename to tests/typ/code/closure.typ diff --git a/tests/typ/comment.typ b/tests/typ/code/comment.typ similarity index 100% rename from tests/typ/comment.typ rename to tests/typ/code/comment.typ diff --git a/tests/typ/expr/dict.typ b/tests/typ/code/dict.typ similarity index 100% rename from tests/typ/expr/dict.typ rename to tests/typ/code/dict.typ diff --git a/tests/typ/control/for-pattern.typ b/tests/typ/code/for-pattern.typ similarity index 100% rename from tests/typ/control/for-pattern.typ rename to tests/typ/code/for-pattern.typ diff --git a/tests/typ/control/for.typ b/tests/typ/code/for.typ similarity index 100% rename from tests/typ/control/for.typ rename to tests/typ/code/for.typ diff --git a/tests/typ/control/if.typ b/tests/typ/code/if.typ similarity index 100% rename from tests/typ/control/if.typ rename to tests/typ/code/if.typ diff --git a/tests/typ/control/invalid.typ b/tests/typ/code/invalid.typ similarity index 100% rename from tests/typ/control/invalid.typ rename to tests/typ/code/invalid.typ diff --git a/tests/typ/control/let.typ b/tests/typ/code/let.typ similarity index 100% rename from tests/typ/control/let.typ rename to tests/typ/code/let.typ diff --git a/tests/typ/expr/ops-invalid.typ b/tests/typ/code/ops-invalid.typ similarity index 100% rename from tests/typ/expr/ops-invalid.typ rename to tests/typ/code/ops-invalid.typ diff --git a/tests/typ/expr/ops.typ b/tests/typ/code/ops.typ similarity index 100% rename from tests/typ/expr/ops.typ rename to tests/typ/code/ops.typ diff --git a/tests/typ/expr/prec.typ b/tests/typ/code/prec.typ similarity index 100% rename from tests/typ/expr/prec.typ rename to tests/typ/code/prec.typ diff --git a/tests/typ/repr.typ b/tests/typ/code/repr.typ similarity index 100% rename from tests/typ/repr.typ rename to tests/typ/code/repr.typ diff --git a/tests/typ/control/while.typ b/tests/typ/code/while.typ similarity index 100% rename from tests/typ/control/while.typ rename to tests/typ/code/while.typ diff --git a/tests/typ/expand.typ b/tests/typ/layout/fixed.typ similarity index 91% rename from tests/typ/expand.typ rename to tests/typ/layout/fixed.typ index 8b858a4ef..bcb88fe1a 100644 --- a/tests/typ/expand.typ +++ b/tests/typ/layout/fixed.typ @@ -1,4 +1,4 @@ -// Test fit/fill expansion. +// Test shrink-to-fit vs fixed. --- #let right(body) = align(right, body) diff --git a/tests/typ/spacing.typ b/tests/typ/spacing.typ deleted file mode 100644 index bb86a59c8..000000000 --- a/tests/typ/spacing.typ +++ /dev/null @@ -1,35 +0,0 @@ -// Test spacing around control flow structures. - ---- -// Spacing around let. - -// Error: 6 expected identifier -A#let;B \ -A#let x = 1;B #test(x, 1) \ -A #let x = 2;B #test(x, 2) \ -A#let x = 3; B #test(x, 3) - ---- -// Spacing around if-else. - -A#if true [B]C \ -A#if true [B] C \ -A #if true{"B"}C \ -A #if true{"B"} C \ -A#if false [] #else [B]C \ -A#if true [B] #else [] C - ---- -// Spacing around while loop. - -#let c = true; A#while c [{c = false}B]C \ -#let c = true; A#while c [{c = false}B] C \ -#let c = true; A #while c { c = false; "B" }C \ -#let c = true; A #while c { c = false; "B" } C - ---- -// Spacing around for loop. - -A#for _ in (none,) [B]C \ -A#for _ in (none,) [B] C \ -A #for _ in (none,) {"B"}C diff --git a/tests/typ/text/whitespace.typ b/tests/typ/text/whitespace.typ index 3d7dd2e2f..418c3a129 100644 --- a/tests/typ/text/whitespace.typ +++ b/tests/typ/text/whitespace.typ @@ -1,5 +1,39 @@ // Test whitespace handling. +--- +// Spacing around let. + +// Error: 6 expected identifier +A#let;B \ +A#let x = 1;B #test(x, 1) \ +A #let x = 2;B #test(x, 2) \ +A#let x = 3; B #test(x, 3) + +--- +// Spacing around if-else. + +A#if true [B]C \ +A#if true [B] C \ +A #if true{"B"}C \ +A #if true{"B"} C \ +A#if false [] #else [B]C \ +A#if true [B] #else [] C + +--- +// Spacing around while loop. + +#let c = true; A#while c [{c = false}B]C \ +#let c = true; A#while c [{c = false}B] C \ +#let c = true; A #while c { c = false; "B" }C \ +#let c = true; A #while c { c = false; "B" } C + +--- +// Spacing around for loop. + +A#for _ in (none,) [B]C \ +A#for _ in (none,) [B] C \ +A #for _ in (none,) {"B"}C + --- // Test that a run consisting only of whitespace isn't trimmed. A#font("PT Sans")[ ]B