fix(anatomy): R5.4 aligned report tables bounded before they are built, declared case fully held, docs
This commit is contained in:
1 parent
aeb5050502
commit
777c8000b8
8 files changed
+215
-21
No files matched your search
@@ -77,6 +77,20 @@ fn tables_align_as_prettier_aligns_them() {
|
||||
assert_eq!(refused, vec![5], "only the emoji table is refused");
|
||||
}
|
||||
|
||||
/// One long cell pads every row of its column: the aligned table is bounded before any row is
|
||||
/// built (security gate R5.4 round 6: an 80 KB rationale over 14,000 records asked for 1 GB).
|
||||
#[test]
|
||||
fn an_aligned_table_past_the_bound_is_refused_before_it_is_built() {
|
||||
let mut raw = vec!["| a | b |".to_owned(), "| --- | --- |".to_owned()];
|
||||
raw.push(format!("| {} | x |", "w".repeat(2_000)));
|
||||
raw.extend((0..20_000).map(|_| "| a | b |".to_owned()));
|
||||
let error = format_markdown(&raw.join("\n")).unwrap_err();
|
||||
assert!(
|
||||
matches!(&error, PipelineError::Guard(message) if message.contains("exceeds the")),
|
||||
"{error}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slugs_and_uuids_match_the_typescript() {
|
||||
let semantics = oracle("js-semantics.json");
|
||||
|
||||
Reference in new issue
Block a user