| 3368 |
3368 |
|
Self::Descending => "descending",
|
| 3369 |
3369 |
|
}
|
| 3370 |
3370 |
|
}
|
|
3371 |
+ |
|
|
3372 |
+ |
/// The caret a renderer draws for this direction.
|
|
3373 |
+ |
///
|
|
3374 |
+ |
/// Here for [`as_str`](Self::as_str)'s reason, said about a glyph rather
|
|
3375 |
+ |
/// than a word: three renderers picking their own is the drift this crate
|
|
3376 |
+ |
/// ends. They had picked their own — two on the solid triangles and
|
|
3377 |
+ |
/// `makeover-webview` on the arrows U+2191/U+2193 — and agreeing by
|
|
3378 |
+ |
/// coincidence in three files is not agreement.
|
|
3379 |
+ |
///
|
|
3380 |
+ |
/// Settled 2026-08-16 (Max): the solid triangles, U+25B2 and U+25BC. The
|
|
3381 |
+ |
/// reason generalizes past this pair and is the house rule now — prefer the
|
|
3382 |
+ |
/// bolder, simpler glyph over the thinner or more complicated one. A third
|
|
3383 |
+ |
/// spelling is not open for re-argument.
|
|
3384 |
+ |
///
|
|
3385 |
+ |
/// **Bare, with no spacing.** Where the gap goes is each renderer's
|
|
3386 |
+ |
/// business: `makeover-tui` and `makeover-immediate` carry a leading space
|
|
3387 |
+ |
/// inside their `TableStyle` string and a webview emits its own in
|
|
3388 |
+ |
/// `content`, so folding a space in here would make one of the two wrong.
|
|
3389 |
+ |
///
|
|
3390 |
+ |
/// Neither face the web apps self-host carries these — IBM Plex Mono has one
|
|
3391 |
+ |
/// glyph in the whole geometric-shapes block and Lato has none — so a
|
|
3392 |
+ |
/// browser falls back per glyph until the in-house face ships with them
|
|
3393 |
+ |
/// drawn in (makeover `6d6d9146`, wiki `typography-standard`). Cosmetic
|
|
3394 |
+ |
/// drift in one renderer, not a reason to spell it three ways.
|
|
3395 |
+ |
#[must_use]
|
|
3396 |
+ |
pub const fn glyph(self) -> &'static str {
|
|
3397 |
+ |
match self {
|
|
3398 |
+ |
Self::Ascending => "\u{25B2}",
|
|
3399 |
+ |
Self::Descending => "\u{25BC}",
|
|
3400 |
+ |
}
|
|
3401 |
+ |
}
|
| 3371 |
3402 |
|
}
|
| 3372 |
3403 |
|
|
| 3373 |
3404 |
|
impl<'a> Column<'a> {
|
| 3529 |
3560 |
|
assert_eq!(Sort::Ascending.as_str(), "ascending");
|
| 3530 |
3561 |
|
}
|
| 3531 |
3562 |
|
|
|
3563 |
+ |
#[test]
|
|
3564 |
+ |
fn a_direction_carries_its_caret_and_the_two_are_not_the_same_glyph() {
|
|
3565 |
+ |
// The spelling every renderer reads, so that agreeing is composition
|
|
3566 |
+ |
// rather than three files happening to hold the same literal.
|
|
3567 |
+ |
assert_eq!(Sort::Ascending.glyph(), "\u{25B2}");
|
|
3568 |
+ |
assert_eq!(Sort::Descending.glyph(), "\u{25BC}");
|
|
3569 |
+ |
assert_ne!(Sort::Ascending.glyph(), Sort::Descending.glyph());
|
|
3570 |
+ |
// Bare. The gap is the renderer's, and a space here would be a second
|
|
3571 |
+ |
// one wherever a renderer already carries its own.
|
|
3572 |
+ |
for d in [Sort::Ascending, Sort::Descending] {
|
|
3573 |
+ |
assert_eq!(d.glyph().trim(), d.glyph());
|
|
3574 |
+ |
}
|
|
3575 |
+ |
}
|
|
3576 |
+ |
|
| 3532 |
3577 |
|
#[test]
|
| 3533 |
3578 |
|
fn a_figure_carries_its_tone_because_no_renderer_can_derive_it() {
|
| 3534 |
3579 |
|
// Three of goingson's five sites tone the figure by their own means, so
|