diff --git a/Cargo.lock b/Cargo.lock index a3777210e3..c1b9b5cc13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3456,6 +3456,7 @@ name = "craft-ods" version = "0.1.0" dependencies = [ "craft-odf", + "craft-ods", "craft-sheet", "craft-xml", "thiserror 2.0.21", diff --git a/crates/ods/Cargo.toml b/crates/ods/Cargo.toml index 814e6d9c3e..3b405d8ee4 100644 --- a/crates/ods/Cargo.toml +++ b/crates/ods/Cargo.toml @@ -10,6 +10,10 @@ repository.workspace = true [lints] workspace = true +[features] +# `testing`: small `.ods` packages built in code, for the tests of crates that read them. +test-support = [] + [dependencies] craft-odf = { workspace = true } craft-sheet = { workspace = true } @@ -18,3 +22,4 @@ thiserror = { workspace = true } [dev-dependencies] craft-odf = { workspace = true } +craft-ods = { path = ".", features = ["test-support"] } diff --git a/crates/ods/README.md b/crates/ods/README.md index 0246578b77..966b681dff 100644 --- a/crates/ods/README.md +++ b/crates/ods/README.md @@ -41,3 +41,9 @@ every cell after that point and sets `Workbook::text_truncated`, so the caller c of failing. Rows and cells after the cell that passes it are not read. The one-cell limit still applies to every cell read, that cell included; the cell and merged-range limits count the cells kept. + +## Features + +- `test-support` enables `testing`, which builds small `.ods` packages in code (`spreadsheet`, + `content`, `package`) for the tests of crates that read spreadsheets. It is not a general + spreadsheet writer. diff --git a/crates/ods/src/lib.rs b/crates/ods/src/lib.rs index c816905a91..ff5ea0f286 100644 --- a/crates/ods/src/lib.rs +++ b/crates/ods/src/lib.rs @@ -30,6 +30,7 @@ mod content; mod model; +#[cfg(any(test, feature = "test-support"))] #[doc(hidden)] pub mod testing;