summaryrefslogtreecommitdiff
path: root/src/geom
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-02 19:37:10 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-02 19:37:10 +0100
commit1c40dc42e7bc7b799b77f06d25414aca59a044ba (patch)
treeea8bdedaebf59f5bc601346b0108236c7264a29d /src/geom
parent8cad78481cd52680317032c3bb84cacda5666489 (diff)
Dynamic values, Types, Arrays, and Dictionaries 🚀
- Identifiers are now evaluated as variables instead of being plain values - Constants like `left` or `bold` are stored as dynamic values containing the respective rust types - We now distinguish between arrays and dictionaries to make things more intuitive (at the cost of a bit more complex parsing) - Spans were removed from collections (arrays, dictionaries), function arguments still have spans for the top-level values to enable good diagnostics
Diffstat (limited to 'src/geom')
-rw-r--r--src/geom/length.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/geom/length.rs b/src/geom/length.rs
index 061510a1..0e445153 100644
--- a/src/geom/length.rs
+++ b/src/geom/length.rs
@@ -208,14 +208,14 @@ mod tests {
use super::*;
#[test]
- fn test_length_formats_correctly() {
- assert_eq!(Length::pt(-28.34).to_string(), "-1.00cm".to_string());
- assert_eq!(Length::pt(23.0).to_string(), "23.00pt".to_string());
- assert_eq!(Length::cm(12.728).to_string(), "12.73cm".to_string());
+ fn test_length_unit_conversion() {
+ assert!((Length::mm(150.0).to_cm() - 15.0) < 1e-4);
}
#[test]
- fn test_length_unit_conversion() {
- assert!((Length::mm(150.0).to_cm() - 15.0) < 1e-4);
+ fn test_length_formatting() {
+ assert_eq!(Length::pt(-28.34).to_string(), "-1.00cm".to_string());
+ assert_eq!(Length::pt(23.0).to_string(), "23.00pt".to_string());
+ assert_eq!(Length::cm(12.728).to_string(), "12.73cm".to_string());
}
}