mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 07:46:07 +00:00
Merge pull request #7398 from storytold/feat/craft-libs-migration
Migrate CAD (DXF), EPS/PostScript, and SVG to craft-libs (#778)
This commit is contained in:
@@ -16,7 +16,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"DXF Info",
|
||||
[],
|
||||
None,
|
||||
"{path} or {name?, dataBase64} what a DXF drawing holds → {version (2018, R12…), units (its drawing unit: Millimeters, Inches, Unitless…), layouts: [\"Model\", paper layouts…], layers: [name…], unit, scale (the default ratio: 1 unit = scale drawing units, the drawing at 1:1)}; a binary DXF or a DWG answers an error saying to save it as ASCII DXF",
|
||||
"{path} or {name?, dataBase64} what a DXF drawing holds → {version (2018, R12…), units (its drawing unit: Millimeters, Inches, Unitless…), layouts: [\"Model\", paper layouts…], layers: [name…], unit, scale (the default ratio: 1 unit = scale drawing units, the drawing at 1:1)}; a DWG answers an error saying to save it as DXF",
|
||||
always,
|
||||
dxf_info
|
||||
)]
|
||||
|
||||
@@ -163,12 +163,12 @@ fn dxf_info_lists_layouts_layers_and_units() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn binary_dxf_says_to_save_it_as_ascii() {
|
||||
fn damaged_binary_dxf_says_so() {
|
||||
let mut s = Session::new();
|
||||
let mut bytes = vectorcraft_cad::import::BINARY_SENTINEL.to_vec();
|
||||
bytes.extend([0u8; 64]);
|
||||
let e = open(&mut s, &bytes, json!({})).unwrap_err().to_string();
|
||||
assert!(e.contains("binary DXF") && e.contains("ASCII"), "{e}");
|
||||
assert!(e.contains("binary DXF") && e.contains("damaged"), "{e}");
|
||||
let e = s.execute("document.dxfInfo", &json!({"dataBase64": b64(&bytes)})).unwrap_err().to_string();
|
||||
assert!(e.contains("binary DXF"), "{e}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user