From cc56b79683435b7db8f6bb7b8e47bc60c429f665 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 8 Sep 2023 22:42:24 -0400 Subject: [PATCH] Add a test showing we're not handling table formulas. --- org_mode_samples/greater_element/table/with_formulas.org | 8 ++++++++ src/compare/diff.rs | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 org_mode_samples/greater_element/table/with_formulas.org diff --git a/org_mode_samples/greater_element/table/with_formulas.org b/org_mode_samples/greater_element/table/with_formulas.org new file mode 100644 index 0000000..a48f48a --- /dev/null +++ b/org_mode_samples/greater_element/table/with_formulas.org @@ -0,0 +1,8 @@ +| Name | Price | Quantity | Total | +|------+-------+----------+-------| +| foo | 7 | 4 | 28 | +| bar | 3.5 | 3 | 10.5 | +|------+-------+----------+-------| +| | | 7 | 38.5 | +#+tblfm: $4=$2*$3::@>$4=vsum(@2..@-1) +#+tblfm: @>$3=vsum(@2..@-1) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index bc812d1..7e59baf 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1075,6 +1075,10 @@ fn compare_table<'s>( Ok(_) => {} }; + // TODO: Compare :type :tblfm :value + // + // :tblfm is a list () filled with quoted strings containing the value for any tblfm keywords at the end of the table. + for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) { child_status.push(compare_table_row(source, emacs_child, rust_child)?); } @@ -1112,6 +1116,10 @@ fn compare_table_row<'s>( Ok(_) => {} }; + // TODO: Compare :type + // + // :type is an unquoted atom of either standard or rule + for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) { child_status.push(compare_table_cell(source, emacs_child, rust_child)?); }